Sign Up
Loading...

Process images

Read image details, make smaller copies, crop, rotate or change the format. Add these commands from File Manager in an endpoint, server function or event. They also work when a published function is called in the background and in supported endpoint test suites.

Choose your image

Use a file containing its contents: an uploaded file, a file returned by another command, or Get File with Include bytes enabled. In the File field, choose Variable and select that file. A saved path or ordinary file listing alone is not enough. See Managing Files.

JPEG, PNG and WebP are supported. Animated images and other formats are refused. Each image may have up to 4096 pixels per edge and 8 million pixels in total, with up to 4 MiB of input. Each new output file is limited to 512 KiB. A smaller dimension or lower quality can help when an output is too large.

Image information

Image information returns width, height, format, transparency, page count and input size. Dimensions account for the image's automatic orientation. It does not create another file.

Resize image

Choose Width, Height, or both. For a 1200-pixel-wide thumbnail, enter 1200 for Width and leave Height empty to keep its proportions.

  • Inside keeps proportions and fits within the chosen dimensions.

  • Cover fills the dimensions, cropping where needed.

  • Contain keeps the whole image and adds a background where needed.

  • Fill stretches to the dimensions and may change its proportions.

Allow enlargement is false by default, so small images are not enlarged unnecessarily. Choose an optional Format and Quality. Quality ranges from 1 to 100 for JPEG/WebP; PNG stays lossless.

Crop image

Choose Left, Top, Width and Height. Left and Top start at 0 and refer to the automatically oriented image. For example, Left 0, Top 0, Width 200 and Height 200 copies its top-left square. The rectangle must fit inside the image.

Rotate image

Choose Degrees: 0, 90, 180 or 270 clockwise. The image is automatically oriented first. Choose the output format and quality as needed.

Convert image

Choose JPEG, PNG or WebP. The new image removes the source's private image metadata. This does not remove information visible in the picture itself. JPEG uses a white background for transparent areas.

Use the new file

Resize, crop, rotate and convert return a new file in Return as. The original stays unchanged. Use the result in another command, upload it to storage, or return it from your workflow as appropriate. A new file is not automatically saved to File Manager or given a public download link. Use Image information again if you need its final dimensions.

Test with a small sample first. Processing uses shared capacity and does not wait in a file-processing queue: if it is busy, wait before trying again. Invalid files, unsupported content, exhausted limits and unavailable processing show an error instead of silently returning the original. See File processing limits and errors, Testing and Background jobs.

Related Topics

Cryptography commands

Create checksums, protect text with encryption, sign and verify messages, and compare private text in endpoints, server functions and events. Find these commands under Security when adding a command. They use the familiar variable selector and Return as field. Keep shared signing keys in [Globals & ...

Realtime commands

Use these commands in endpoints, server functions and events to connect authenticated customers and send live notifications. Start with [Realtime channels](/docs/builder/realtime) to create a channel and choose its audience. Authorize Realtime. Issue a one-use connection ticket for the signed-in cus...

Session Storage

Twidget includes a suite of session storage commands that enable no-code interaction with the browser’s `sessionStorage` API. These tools allow temporary storage of key-value data for the current page session. Purpose. Session storage commands allow developers to manage transient data tied to a sing...

Conversion

Overview. Twidget's conversion commands allow you to easily convert different data types to the required format. Below is a list of the available conversion commands and examples of how to use them. The `Convert to Text` command converts the provided value to a text (string) format. Examples: - `123...

Page Security

Use these commands in page workflows to check reCAPTCHA before accepting a form submission. Configure your keys first; see [Page Settings](/docs/pages/page-settings) and the existing [reCAPTCHA guide](/docs/pages/recaptcha). Generate reCAPTCHA token. Generates a token for the current interaction. Th...