Image Kit icon

Image Kit

HTML to Image conversion service with font support

Face → Scale Image

AI-generated

Summary

Scale an input image by specifying a scaling mode and target dimensions, producing a resized image output.

Inputs

  • imageBinaryField (required) — Name of the binary field containing the input image to scale.
  • mode (required) — Scaling mode to apply, such as 'fit' (preserve aspect ratio and fit within bounds), 'fill' (crop to fill bounds), or 'stretch' (ignore aspect ratio).
  • outputFormat (required) — Output image format, supports 'png', 'jpeg', or 'webp'.
  • width — Target width in pixels for the scaled image; can be 0 or omitted if only height is specified.
  • height — Target height in pixels for the scaled image; can be 0 or omitted if only width is specified.

Output shape

a single record with JSON and binary data

Returns an object containing JSON metadata about the scaled image (format, width, height) and binary data of the scaled image file. Binary data is prepared with an appropriate filename and MIME type matching the output format. At least one of width or height must be specified greater than 0; otherwise, the operation throws an error. The output is paired with the input item index.

Links

Discussion