Skip to Content
ConnectImage Transforms

Image Transforms

The Buildpad Engine can resize, crop and convert an image when it serves it. Add transform parameters to /api/files/assets/:id on the Engine, or to a signed URL. The Studio’s own /api/assets/:id route sends the parameters on to the Engine. The Engine checks the credential first: a caller who cannot read the original cannot read a transformed copy.

GET /api/files/assets/<id>?width=300&height=200&fit=cover&quality=80 GET /api/files/assets/<id>?key=system-medium-cover

On a Buildpad Cloud project, image transforms need data service version 2026.10.11 or later. To use them on an older project, update the data service version.

Parameters

ParameterValuesDescription
width1–4096Target width in pixels
height1–4096Target height in pixels
fitcover, contain, inside, outsideResize mode. With both sizes and no fit, the Engine uses cover
quality1–100JPEG quality. The default is 80. It has no effect on PNG and TIFF
formatauto, jpg (or jpeg), png, tiffOutput format. auto is the default
withoutEnlargementtrue, falseDo not make the image larger than its own size
focal_point_x, focal_point_ypixelsThe point that cover crops around. Give both or neither. Without them, the Engine uses the file’s own focal point, then the center
keypreset nameA preset. See Presets

How the fit modes work:

  • cover: exactly width × height. The Engine crops the image around the focal point.
  • contain: exactly width × height. The whole image is centered on a black background.
  • inside: the largest image with the same aspect ratio that fits in the box.
  • outside: the smallest image with the same aspect ratio that covers the box.
  • With only one of width and height, the Engine calculates the other from the aspect ratio, whatever fit says.

How the formats work:

  • auto keeps a JPEG as JPEG and a PNG as PNG. It changes any other image to PNG when the image has transparency, and to JPEG when it has none.
  • The Engine cannot write WebP or AVIF. A request for webp or avif gets the auto result, JPEG or PNG.
  • A request with only quality or format changes the encoding and keeps the size.

The Engine reads JPEG, PNG, GIF, WebP, TIFF and BMP. It applies the EXIF orientation before it resizes, and it removes the EXIF and other metadata from the result. An animated GIF becomes a still image of its first frame. Other files, such as PDF, SVG, video, HEIC, AVIF and animated WebP, come back unchanged, and the transform parameters are ignored.

Presets

key names a preset. The six system presets are always available:

KeyResult
system-small-cover64 × 64, cover
system-small-containwidth 64, contain
system-medium-cover300 × 300, cover
system-medium-containwidth 300, contain
system-large-cover800 × 800, cover
system-large-containwidth 800, contain

Each system preset uses format=auto. An administrator can add more presets in the storage_asset_presets setting (PATCH /api/settings). It is a list of objects, each with a unique key that does not start with system-, and the transform parameters above:

{ "storage_asset_presets": [ { "key": "card", "width": 120, "height": 90, "fit": "cover" } ] }

Parameters in the request take the place of the preset’s values. For example, ?key=card&width=60 gives a 60 × 90 image.

The Engine refuses a settings write with a list that is not valid, with 400 INVALID_PAYLOAD, and writes nothing.

Transform mode

The storage_asset_transform setting controls which transforms the Engine accepts. The Engine reads it on each request, so a change applies at once.

ValueAccepted
all (the default, also when empty)Every transform
presetsOnly a key that names a preset, with no other transform parameter
noneOnly a key that names a system preset, with no other transform parameter. Any other stored value acts as none

A request with no transform parameter gets the original file in every mode. An administrator sets the mode with PATCH /api/settings. A value other than all, presets and none is refused with 400 INVALID_PAYLOAD.

Limits

The Engine refuses an image that is too large before it decodes it. The operator can change each limit with an Engine setting:

LimitDefaultEngine setting
Size of the original file25 MiBASSETS_TRANSFORM_MAX_INPUT_BYTES
Longest side of the original6,000 pixelsASSETS_TRANSFORM_IMAGE_MAX_DIMENSION
Pixels in the original24,000,000ASSETS_TRANSFORM_MAX_INPUT_PIXELS
Longest side of the result4,096 pixelsASSETS_TRANSFORM_MAX_OUTPUT_DIMENSION
Time for one transform7.5 secondsASSETS_TRANSFORM_TIMEOUT_MS
Transforms at the same time, in one Engine process2ASSETS_TRANSFORM_MAX_CONCURRENT
Requests that wait for a free slot4ASSETS_TRANSFORM_MAX_WAITING
Time that a request waits for a slot2 secondsASSETS_TRANSFORM_WAIT_MS

The Engine keeps each result in the file’s storage location and serves it again without a new transform. It keeps up to 32 results for each file. When a file is replaced or deleted, the Engine removes its results. A result is not a file: it does not appear in GET /api/files.

Errors

StatusCodeMeaning
400INVALID_QUERYA parameter is not valid, is given twice, or names a preset that does not exist (Key "<key>" isn't configured). Also a transform that the transform mode does not allow
400ILLEGAL_ASSET_TRANSFORMATIONThe image is larger than a limit, or the Engine cannot decode it
503SERVICE_UNAVAILABLEThe transform took too long, or every slot is busy. The answer has Retry-After: 2