← All tools
Resize image
Imageimage.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 modality | Image file (URL) |
| Output modality | Image file (GCS URL) |
| Max input size | 50 MB |
| Supported formats | JPEG, PNG, WebP, TIFF, AVIF, GIF |
Parameters
| Param | Required | Description |
|---|---|---|
width | one of | Target width in pixels (integer > 0). |
height | one of | Target height in pixels (integer > 0). At least one of width or height is required. |
fit | no | Resize 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 resizingimage.convert_format— change format/quality after resizeimage.pipeline— chain resize with other ops in a single execution
Examples
800×600 cover
{
"width": 800,
"height": 600,
"fit": "cover"
}