Crop Image

Crop an image to a specified rectangular region

transform 1 credit

Crop

Crop an image to a specified rectangular region

Overview

The Crop node extracts a specific rectangular region from an image by defining a starting point (top-left corner) and dimensions (width and height). This gives you precise control over which part of the image to keep.

Usage Tips

  • Specify exact pixel coordinates for the top-left corner (start_x, start_y)
  • Define the width and height of the region to extract
  • Use for extracting logos, watermarks, or specific image regions
  • Great for removing unwanted borders or focusing on specific areas
  • Combine with Image Attributes to calculate crop coordinates dynamically

Common Pairings

  • Image Attributes - Get image dimensions to calculate crop regions
  • Size Maths - Calculate crop coordinates based on percentages
  • Smart Crop - Use smart crop first, then precise crop for fine-tuning
  • Resize - Scale the cropped region to desired final dimensions

Gotchas

  • Coordinates start from (0, 0) at the top-left corner
  • If crop region exceeds image bounds, dimensions are auto-adjusted to fit
  • Unlike Smart Crop, this requires you to specify exact coordinates
  • Use Image Attributes node to get source image dimensions if needed

Technical Reference

Inputs

NameTypeRequiredDescription
inputImageYesImage to crop

Outputs

NameTypeDescription
outputImageCropped image

Parameters

NameTypeDefaultDescription
params_start_xnumber0X coordinate of top-left corner
params_start_ynumber0Y coordinate of top-left corner
params_widthnumber100Width of crop region in pixels
params_heightnumber100Height of crop region in pixels