Infery.ai
← All tools

Resize image

Image

image.resize

in: imageout: image

Resize image to target dimensions.

Pricing

Price
0.125 cr / request

Prices in credits (1 credit = $0.01).

Resize Image

Scale an image to target dimensions using the Sharp library's high-performance resize engine.

When to use

  • Generate thumbnails — produce preview images at fixed width or height.
  • Normalize uploads — standardize user-uploaded images to a maximum size before storage.
  • Responsive variants — generate multiple resolutions (1x, 2x) for a responsive image pipeline.

Inputs & outputs

Input modalityImage file (URL)
Output modalityImage file (GCS URL)
Max input size50 MB
Supported formatsJPEG, PNG, WebP, TIFF, AVIF, GIF

Parameters

ParamRequiredDescription
widthone ofTarget width in pixels (integer > 0).
heightone ofTarget height in pixels (integer > 0). At least one of width or height is required.
fitnoResize strategy — cover (default), contain, fill, inside, outside.

Examples

Thumbnail at 300 × 300 cover

{
  "type": "image.resize",
  "input": { "image_url": "gs://infery-prod-media/photos/original.png" },
  "params": { "width": 300, "height": 300, "fit": "cover" }
}

Constrain to max 1280 px wide (preserve aspect)

{
  "type": "image.resize",
  "input": { "image_url": "gs://infery-prod-media/photos/original.jpg" },
  "params": { "width": 1280, "fit": "inside" }
}

Pricing

Billed per megapixel of output image. See pricing dashboard for current rates.

Related capabilities

  • image.crop — crop to a specific rectangle after resizing
  • image.convert_format — change format/quality after resize
  • image.pipeline — chain resize with other ops in a single execution

Examples

800×600 cover

{
  "width": 800,
  "height": 600,
  "fit": "cover"
}