Images
Introduction
Image files are used in <img> and <picture> tags across the web, in native mobile and desktop apps, and behind-the-scenes for many AI workflows.
You can use image tasks to:
- Convert images to different formats for broader compatibility (JPEG/PNG/WebP/AVIF)
- Compress images to save bandwidth and storage costs
- Resize and crop for specific layouts/aspect ratios
- Add text and image overlays (watermarks, badges)
- Shrink images before AI processing to save tokens
Required props
As with all Tasks, you must provide:
- either a urlor afile_idto use as the input file
- the kindof task to create (in this case,image)
File ID
The file_id should be the unique ID of a file in your project’s Files collection.
URL
The url should be the URL of the image file to process.
This should be a publicly accessible or signed URL.
Kind
For image tasks, this is always image.
Supported inputs
Input files can be:
| Property | Values | 
|---|---|
| Image Formats | jpeg, png, webp, avif, gif, heic/heif | 
Input files can be:
- up to 8192px on the longest edge
- up to 4GB in size
Default settings
If you don’t specify any options, the default task will create a new image file with the following settings:
| Setting | Default Value | 
|---|---|
| Width | Same as input file | 
| Height | Same as input file | 
| Fit | fill | 
| Position | center | 
| Background | transparent if supported; else black ( #000000) | 
| Format | Same as input file | 
| Quality | 80 (where applicable) | 
| Layers | None | 
If you just want to normalize uploaded images for web delivery, this is a reasonable set of defaults. We automatically respect EXIF orientation and (by default) strip metadata for privacy.
Shared options
All tasks support the following (optional) props:
- filename
- folder
- ref
See the Tasks documentation for more information on these options.
Image options
Image tasks support a number of optional properties to control the output.
As a simple example, you can just resize an image to a specific width (height is calculated to maintain the original aspect ratio):
You can combine options in a single task to create a wide range of output images.
For example, you can set a custom width, height, fit, position, background, format, quality, and add overlay layers.
Width
The width of the output image in pixels or as a percentage of the input file.
If you pass a percentage, it’s relative to the input’s width.
Height
The height of the output image in pixels or as a percentage of the input file.
If you pass a percentage, it’s relative to the input’s height.
Fit
How the image should be scaled to fit the width and height.
Available fits are:
- fill (default) – stretch to the exact width and height provided (may distort the image)
- cover – scale to cover the width and height, whilst preserving aspect ratio (may crop the image)
- contain – scale to fit the full image inside the width and height, whilst preserving aspect ratio (may add padding around the image aka letterboxing)
If only one of width or height is specified, the other will be calculated to maintain the original aspect ratio and fit will be ignored.
Position
Used with fit: cover or fit: contain, positions the image within the output frame.
Available positions are:
center (default), top, bottom, left, right, top left, top right, bottom left, bottom right.
Background
Used with fit: contain to fill any extra space. Hex color (e.g. #20B075) or the word transparent (for formats that support alpha).
If not specified, background is transparent for alpha-capable outputs (PNG/WebP/AVIF), otherwise black (#000000).
Format
The output format of the image.
Available formats: jpeg, png, webp, avif.
If omitted, we keep the source format where possible.
Quality
Relative quality setting (where applicable), between 1 and 100.
Default is 80, which reduces file size but is quite conservative. It's often safe to be more aggressive with quality.
Layers
Layers let you add text and image overlays to the output. The layers prop accepts an array of objects.
A full “Layers” guide with visual examples is coming soon. If you’d like an early preview, contact us.