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 provides image compression functionality within an n8n workflow. It allows users to compress images supplied in various formats—binary data from a previous node, base64-encoded strings, or via a URL. The node supports outputting the compressed image in either JPG or PNG format and offers configurable compression levels (Max, Medium, Low). Additionally, it can process large files asynchronously to improve performance.
Typical use cases include optimizing images for web usage by reducing file size without significant quality loss, preparing images for email attachments, or automating image optimization workflows in content management systems.
Properties
| Name | Meaning |
|---|---|
| Input Image Data Type | Choose how to provide the image file to compress. Options: Binary Data (from previous node), Base64 String, URL to image file. |
| Input Binary Field | Name of the binary property containing the image file (used when Input Image Data Type is Binary Data). |
| Base64 Image Content | Base64 encoded string representing the image content (used when Input Image Data Type is Base64 String). |
| Image URL | URL pointing to the image file to compress (used when Input Image Data Type is URL). |
| Output File Name | Desired name for the output compressed image file. |
| Image Type | Output format for the compressed image. Options: JPG, PNG. |
| Compression Level | Compression intensity level. Options: Max, Medium, Low. |
| Use Async Processing | Whether to use asynchronous processing for large files (true/false). |
Output
The node outputs the compressed image data in the json field of the returned items. The compressed image is typically provided as binary data under the specified output binary property (not explicitly shown but standard for image processing nodes). The output includes the compressed image file with the chosen filename and format.
If the node handles binary data input, the output will be binary data representing the compressed image. For base64 or URL inputs, the output similarly contains the compressed image data ready for further workflow steps.
Dependencies
- Requires access to an external image compression service or library integrated within the node's implementation.
- No explicit API keys or credentials are mentioned in the source code snippet; however, depending on the underlying service used for compression, an API key credential might be required.
- No special environment variables are indicated.
Troubleshooting
Common Issues:
- Providing an incorrect binary property name when using binary data input may cause the node to fail to locate the image.
- Invalid base64 strings or inaccessible URLs will result in errors during image retrieval.
- Unsupported image formats or corrupted image files may cause compression to fail.
- Large files might time out if asynchronous processing is disabled.
Error Messages:
- Errors related to missing input data or invalid input format usually indicate misconfiguration of the input properties.
- Network errors when using URL input suggest connectivity issues or invalid URLs.
- Compression failures might require checking the input image integrity or adjusting compression level settings.
Resolutions:
- Verify that the binary property name matches the actual binary data field.
- Ensure base64 strings are correctly encoded and complete.
- Confirm URLs are accessible and point directly to image files.
- Enable asynchronous processing for large images to avoid timeouts.