Infery.ai
← All tools

Crop image

Image

image.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 modalityImage file (URL)
Output modalityImage file (GCS URL)
Max input size50 MB
Supported formatsJPEG, PNG, WebP, TIFF, AVIF, GIF

Parameters

ParamRequiredDescription
xyesLeft offset in pixels from the top-left corner (integer ≥ 0).
yyesTop offset in pixels from the top-left corner (integer ≥ 0).
widthyesWidth of the crop rectangle in pixels (integer > 0).
heightyesHeight 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 cropping
  • image.rotate — rotate before cropping to align content
  • image.pipeline — chain crop with other ops in a single execution

Examples

Center 400×400

{
  "x": 200,
  "y": 100,
  "width": 400,
  "height": 400
}