Documentation
Operations
Reference the supported resize, optimize, tile, grid_render, and tile_patch option schemas.
Last updated: May 11, 2026
ImageGrid normalizes job options before persisting the job. That means defaults are filled in, unsupported fields are rejected, and some output choices depend on the source asset format.
Operation summary
| Operation | Requires asset_id |
Purpose |
|---|---|---|
resize |
Yes | Resize to a target width and/or height. |
optimize |
Yes | Re-encode a source image with an output format and optional quality/lossless settings. |
tile |
Yes | Build tiled outputs for deep zoom or single-resolution delivery. |
grid_render |
No | Render a new tile set from a generated block grid. |
tile_patch |
No | Patch regions inside an existing tileset. |
Shared option behavior
optionsmust always be a JSON object.- Unsupported option keys are rejected.
- Integer fields must be integers, not strings.
- Color fields must use
#RRGGBB. resizeandoptimizeaccept uploaded still-imagejpeg,png,webp,gif,avif,heif, andjxlinputs when the current runtime can decode them.tile,grid_render, andtile_patchstay on the tiled-output set ofjpeg,png, andwebp.
resize
Use resize when you need a new derivative with a target width, height, or both.
Accepted options:
| Field | Type | Required | Default |
|---|---|---|---|
width |
integer | No, but width or height is required |
none |
height |
integer | No, but width or height is required |
none |
fit |
string | No | inside |
format |
string | No | source image format when encodable, otherwise jpeg |
quality |
integer | No | 80 for lossy formats |
Allowed fit values:
containcoverfillinsideoutside
Example:
{
"asset_id": "00000000-0000-0000-0000-000000000000",
"operation": "resize",
"options": {
"width": 1600,
"height": 900,
"fit": "inside",
"format": "webp"
}
}
Notes:
- You can always specify an explicit output
format. - If the source format is accepted as input but the current runtime cannot encode that same format, omitting
formatfalls back tojpeg. - GIF output is always flattened to a single still frame.
- AVIF, HEIF, and JXL output support depends on deployed codec support. Specify
jpeg,png, orwebpwhen you need the most portable output path.
optimize
Use optimize when you want a smaller or more suitable encoded variant without changing the image dimensions directly.
Accepted options:
| Field | Type | Required | Default |
|---|---|---|---|
format |
string | No | source image format when encodable, otherwise a runtime-safe fallback |
quality |
integer | No | 80 for lossy formats when not lossless |
lossless |
boolean | No | false |
Notes:
lossless: trueis allowed forwebp.lossless: truewithformat: "jpeg"is rejected.gif,avif,heif, andjxloutput support is runtime-dependent and may be rejected on builds that lack the required codec support.- You can always specify an explicit output
format. - If the source format is accepted as input but the current runtime cannot encode it, omitting
formatfalls back tojpeg. - If
lossless: trueis set and the source format is input-only in the current runtime, omittedformatfalls back towebp, thenpng. - GIF output is always flattened to a single still frame.
- AVIF, HEIF, and JXL output support depends on deployed codec support. Specify
jpeg,png, orwebpwhen you need the most portable output path.
Example:
{
"asset_id": "00000000-0000-0000-0000-000000000000",
"operation": "optimize",
"options": {
"format": "jpeg",
"quality": 82
}
}
tile
Use tile when you need multi-tile output from an existing source image.
Accepted options:
| Field | Type | Required | Default |
|---|---|---|---|
tile_size |
integer | No | 256 |
overlap |
integer | No | 0 |
format |
string | No | source image format or webp fallback |
min_level |
integer | No | none |
max_level |
integer | No | none |
strategy |
string | No | deepzoom |
preprocess |
object | No | none |
Allowed strategy values:
deepzoomsingle-resolution
single-resolution requires min_level and max_level to match when both are provided.
preprocess
tile can apply a preprocessing stage before tile generation:
| Field | Type | Required |
|---|---|---|
rotate |
integer | No |
crop |
object | No |
Allowed rotate values:
090180270
crop fields:
| Field | Type | Required |
|---|---|---|
x |
integer | Yes |
y |
integer | Yes |
width |
integer | Yes |
height |
integer | Yes |
Example:
{
"asset_id": "00000000-0000-0000-0000-000000000000",
"operation": "tile",
"options": {
"tile_size": 128,
"format": "png",
"strategy": "deepzoom",
"preprocess": {
"rotate": 90
}
}
}
grid_render
Use grid_render when you want ImageGrid to generate a new tiled grid image without uploading a source asset first.
Accepted options:
| Field | Type | Required | Default |
|---|---|---|---|
width |
integer | Yes | none |
height |
integer | Yes | none |
block_width |
integer | Yes | none |
block_height |
integer | Yes | none |
background_color |
string | No | #ffffff |
grid_line_color |
string | No | #999999 |
grid_line_width |
integer | No | 1 |
show_grid_lines |
boolean | No | true |
tile_size |
integer | No | 256 |
overlap |
integer | No | 0 |
format |
string | No | png |
min_level |
integer | No | none |
max_level |
integer | No | none |
strategy |
string | No | deepzoom |
preprocess |
object | No | none |
grid_render reuses the same tiling options and preprocess rules as tile.
Example:
{
"operation": "grid_render",
"options": {
"width": 640,
"height": 320,
"block_width": 32,
"block_height": 32,
"background_color": "#ffffff",
"grid_line_color": "#999999",
"grid_line_width": 1,
"show_grid_lines": true,
"format": "png"
}
}
tile_patch
Use tile_patch to modify one or more regions of an existing tileset.
tile_patch is designed for immediate updates. Large burst rebuilds may need review before they fit the normal self-serve path, even when each patch is small.
Accepted top-level options:
| Field | Type | Required |
|---|---|---|
tileset_id |
string (UUID) | Yes |
patches |
array | Yes |
Each patch requires:
| Field | Type | Required |
|---|---|---|
type |
string | Yes |
x |
integer | Yes |
y |
integer | Yes |
width |
integer | Yes |
height |
integer | Yes |
Allowed patch types:
colorasset
Color patch
Additional fields:
| Field | Type | Required |
|---|---|---|
color |
string | Yes |
Example:
{
"operation": "tile_patch",
"options": {
"tileset_id": "00000000-0000-0000-0000-000000000000",
"patches": [
{
"type": "color",
"color": "#ff0000",
"x": 0,
"y": 0,
"width": 32,
"height": 32
}
]
}
}
Asset patch
Additional fields:
| Field | Type | Required | Default |
|---|---|---|---|
asset_id |
string (UUID) | Yes | none |
fit |
string | No | cover |
Allowed fit values match resize:
containcoverfillinsideoutside
Choosing the right operation
- Use
resizewhen the source image already exists and you need dimension changes. - Use
optimizewhen the source image already exists and you mainly need output encoding control. - Use
tilewhen the source image already exists and you need tiled output. - Use
grid_renderwhen the source image does not exist yet and you need ImageGrid to generate a tiled grid. - Use
tile_patchwhen you need to modify an existing tileset rather than regenerate it from scratch.