ImageMagick icon

ImageMagick

Verarbeitung von Bildern und PDFs mit ImageMagick

Crop

AI-generated

Summary

Crops a source image to a specific width, height, and coordinates using the ImageMagick API.

Inputs

  • Input Source — Source of the file: 'binaryData' (from a previous node) or 'url' (to download). Defaults to binaryData.
  • Binary Property — Name of the binary data property to use when 'Input Source' is binaryData. Required only if using binary data.
  • File URL — URL of the file to process when 'Input Source' is url. Required only if using a URL.
  • Output Binary Property — Name for the output binary data property.
  • cropWidth (required) — Width of the crop area in pixels.
  • cropHeight (required) — Height of the crop area in pixels.
  • cropX — X position of the top-left corner of the crop area, starting from the left edge. Defaults to 0.
  • cropY — Y position of the top-left corner of the crop area, starting from the top edge. Defaults to 0.
  • outputFormat — Target output format (jpg, png, webp, gif, bmp, tiff, pdf). If omitted, the original file extension is preserved.

Output shape

One processed item per input item, with a binary property containing the cropped image.

If the input source is a URL, the node attempts to infer the filename from the URL path. The output filename is generated as operation_timestamp.extension.

Examples

Example 1: Crop the center 200x200 pixels of a binary image received from a previous node.

Input Source: binaryData, Binary Property: 'data', cropWidth: 200, cropHeight: 200, cropX: 0, cropY: 0

Example 2: Download an image from a URL and crop the top-right quadrant.

Input Source: url, File URL: 'https://example.com/image.jpg', cropWidth: 100, cropHeight: 100, cropX: 100, cropY: 0

Links

Discussion