Actions80
- Extract Text From Word
- Find And Replace Text
- Convert PDF To Editable PDF Using OCR
- Create Swiss QR Bill
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Create PDF/A
- Convert HTML To PDF
- Convert Markdown To PDF
- Upload File To PDF4me
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Fill PDF Form
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- AI-Invoice Parser
- AI-Process HealthCard
- AI-Process Contract
- Generate Barcode
- Classify Document
- Parse Document
- Linearize PDF
- Flatten PDF
- Convert To PDF
- Json To Excel
- Convert PDF To Excel
- Convert PDF To Word
- Convert PDF To PowerPoint
- Convert VISIO
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Extract Pages
- Merge Multiple PDFs
- Overlay PDFs
- Rotate Document
- Rotate Page
- Sign PDF
- URL to PDF
- Add Image Watermark To Image
- Add Text Watermark To Image
- Compress Image
- Convert Image Format
- Create Images From PDF
- Flip Image
- Get Image Metadata
- Image Extract Text
- Remove EXIF Tags From Image
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Image
- Rotate Image By EXIF Data
- Compress PDF
- Get PDF Metadata
- Repair PDF Document
- Get Document From Pdf4me
- Update Hyperlinks Annotation
- Protect Document
- Unlock PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Generate Document Single
- Generate Documents Multiple
- Get Tracking Changes In Word
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Attachment From PDF
- Extract Text By Expression
- Extract Table From PDF
- Extract Resources
Overview
This node performs image cropping operations on input images. It supports cropping by removing borders or cropping to a specific rectangular area within the image. This functionality is useful in workflows where images need to be trimmed, resized, or focused on a particular section before further processing or storage.
Common scenarios include:
- Removing unwanted margins or whitespace from scanned documents or photos.
- Extracting a specific region of interest from an image for analysis or display.
- Preparing images for thumbnails or previews by cropping to fixed dimensions.
For example, you can crop a photo by specifying how many pixels to remove from each border, or define a rectangle area by coordinates and size to extract a portion of the image.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Choose how to provide the image file to crop. Options: Binary Data (image from previous node), Base64 String (base64 encoded image content), URL (link to image file). |
| Input Binary Field | Name of the binary property containing the image file (used when Input Data Type is Binary Data). |
| Base64 Image Content | Base64 encoded string of the image content (used when Input Data Type is Base64 String). |
| Image URL | URL pointing to the image file to crop (used when Input Data Type is URL). |
| Output File Name | Desired name for the output cropped image file. |
| Document Name | Name of the source image file for reference purposes. |
| Crop Type | Type of cropping to perform. Options: Border (crop by removing borders from all sides), Rectangle (crop to a specific rectangular area). |
| Border Cropping Options | When Crop Type is Border, specify number of pixels to crop from Left, Right, Top, and Bottom borders. |
| Rectangle Cropping Options | When Crop Type is Rectangle, specify the X and Y coordinates of the upper left corner of the crop rectangle, plus its Width and Height in pixels. |
| Advanced Options | Custom profiles as JSON string to adjust extra properties for API calls, e.g., output data format. Reference available profiles at https://developer.pdf4me.com/api/profiles/index.html |
Output
The node outputs the cropped image data in JSON format. The output includes the cropped image file, typically as binary data suitable for further processing or saving. The output file will have the specified output file name.
If the input was provided as binary data, base64 string, or URL, the output will consistently represent the cropped image in a binary form ready for downstream nodes.
Dependencies
- Requires access to an external image processing API or service capable of performing cropping operations.
- Needs appropriate API authentication credentials configured in n8n to authorize requests.
- Network access is required if using image URLs or calling external APIs.
Troubleshooting
- Invalid input data: Ensure the input image is correctly provided according to the selected Input Data Type. For binary data, verify the binary field name matches the actual input. For base64 or URL, ensure valid strings/URLs.
- Crop dimensions out of bounds: If cropping coordinates or border sizes exceed the image dimensions, errors may occur. Verify that crop values are within the image size limits.
- API authentication errors: Confirm that the API key or authentication token is properly set up in n8n credentials.
- Network issues: When using image URLs or external API calls, network connectivity problems can cause failures.
- Unsupported image formats: Some image types might not be supported by the cropping service; convert images beforehand if needed.
Links and References
- PDF4me API Profiles Documentation — for advanced options and custom profile settings related to image processing.