Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
The node provides an image cropping functionality as part of a broader PDF and image processing suite. Specifically, the "Crop Image" operation allows users to crop images by either removing borders or selecting a specific rectangular area within the image. This is useful in scenarios where you need to trim unwanted edges from images, focus on a particular section, or prepare images for further processing or presentation.
Practical examples include:
- Automatically trimming white or colored borders from scanned documents.
- Extracting a region of interest from photos or screenshots.
- Preparing images for thumbnails by cropping to a fixed rectangle.
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 representing 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 specified pixels from each border), Rectangle (crop to a defined rectangular area). |
| Border Cropping Options | Collection of options specifying number of pixels to crop from each side: Left Border, Right Border, Top Border, Bottom Border. |
| Rectangle Cropping Options | Collection of options defining the rectangle to crop: Upper Left X and Y coordinates, Width, Height (all in pixels). |
| Output Binary Field Name | Name of the binary property where the cropped image file will be stored. |
| Advanced Options | Optional JSON string to specify custom profiles or additional API call options for advanced use cases. |
Output
The node outputs the cropped image as binary data under a user-defined binary property name (default is "data"). The output includes the cropped image file ready for downstream nodes to consume or save. The output JSON also contains metadata such as the filename.
If the input was provided as base64 or URL, the node converts it internally to binary before cropping and outputs the cropped image similarly as binary data.
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 example, if using binary data, verify the binary property name matches the actual input.
- Cropping parameters out of bounds: If cropping dimensions exceed the image size, errors may occur. Adjust border sizes or rectangle coordinates to fit within the image dimensions.
- Network issues: When providing image URLs or calling external APIs, network connectivity problems can cause failures.
- API errors: Check that API keys are valid and have sufficient permissions. Review error messages returned by the API for guidance.
- Unsupported image formats: Confirm the input image format is supported by the cropping service.
Links and References
- Image Cropping Concepts
- Base64 Encoding
- Example Image Processing APIs (for reference on profiles and advanced options)