← All tools
Crop image
Imageimage.crop
in: imageout: image
Crop image to a rectangle.
Pricing
- Price
- 0.125 cr / request
Prices in credits (1 credit = $0.01).
Crop Image
Extract a rectangular region from an image at a specified offset and size.
When to use
- Focus on subject — cut out the relevant part of a photograph, removing borders or whitespace.
- Prepare for compositing — extract a sub-image before overlaying it on another canvas.
- Aspect-ratio normalization — crop to exact dimensions for social media or print templates.
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 |
|---|---|---|
x | yes | Left offset in pixels from the top-left corner (integer ≥ 0). |
y | yes | Top offset in pixels from the top-left corner (integer ≥ 0). |
width | yes | Width of the crop rectangle in pixels (integer > 0). |
height | yes | Height of the crop rectangle in pixels (integer > 0). |
Examples
Center-crop to 400 × 400
{
"type": "image.crop",
"input": { "image_url": "gs://infery-prod-media/photos/original.jpg" },
"params": { "x": 200, "y": 100, "width": 400, "height": 400 }
}
Extract top-left banner region
{
"type": "image.crop",
"input": { "image_url": "gs://infery-prod-media/banners/full.png" },
"params": { "x": 0, "y": 0, "width": 1200, "height": 300 }
}
Pricing
Billed per megapixel of output image. See pricing dashboard for current rates.
Related capabilities
image.resize— resize to target dimensions before or after croppingimage.rotate— rotate before cropping to align contentimage.pipeline— chain crop with other ops in a single execution
Examples
Center 400×400
{
"x": 200,
"y": 100,
"width": 400,
"height": 400
}