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
- Split PDF By Barcode
- 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
- Split PDF By Swiss QR
- 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 Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
This node provides an image compression operation that reduces the file size of images while maintaining acceptable quality. It supports multiple input methods for providing the image to compress, including binary data from a previous node, base64-encoded strings, or direct URLs to image files. The node outputs a compressed image in either JPG or PNG format with configurable compression levels.
Common scenarios where this node is beneficial include:
- Optimizing images before uploading them to websites or cloud storage to save bandwidth and storage costs.
- Preparing images for email attachments or messaging platforms where file size limits apply.
- Automating image processing workflows where images need to be resized or compressed before further use.
Practical example:
- A user receives images from various sources and wants to compress them automatically before saving to a database or sending via API. They can feed the images as binary data or URLs into this node, select the desired compression level and output format, and get back optimized images ready for downstream processing.
Properties
| Name | Meaning |
|---|---|
| Input Image Data Type | Choose how to provide the image file to compress: "Binary Data" (from previous node), "Base64 String" (base64 encoded content), or "URL" (link to image). |
| Input Binary Field | Name of the binary property containing the image file (used only if Input Image Data Type is "Binary Data"). Default is "data". |
| Base64 Image Content | Base64 encoded string of the image content (used only if Input Image Data Type is "Base64 String"). |
| Image URL | URL pointing to the image file (used only if Input Image Data Type is "URL"). |
| Output File Name | Desired filename for the compressed image output. Default is "compressed_image.jpg". |
| Image Type | Output format for the compressed image: "JPG" or "PNG". |
| Compression Level | Compression intensity: "Max", "Medium", or "Low". |
| Binary Data Output Name | Custom name for the binary data field in the node's output. Default is "data". |
Output
The node outputs the compressed image as binary data under the specified binary data output name (default "data"). The output includes:
json: Metadata about the processed item (usually minimal or empty).binary: Contains the compressed image file data with the chosen filename and MIME type corresponding to the selected image format (JPG or PNG).
This allows subsequent nodes in the workflow to access the compressed image directly for further processing, storage, or transmission.
Dependencies
- The node requires internet access if using the "URL" input option to fetch the image.
- No explicit external API keys or credentials are required based on the provided code.
- The node relies on internal image compression libraries or services bundled within the implementation (not detailed in the source).
Troubleshooting
Common issues:
- Providing an invalid or inaccessible URL when using the URL input type will cause failures fetching the image.
- Incorrect base64 strings may result in decoding errors.
- Specifying a non-existent binary property name when using binary data input will cause the node to fail to find the image.
- Unsupported image formats or corrupted image data might lead to compression errors.
Error messages and resolutions:
- "Image not found in binary property": Verify the binary property name matches the actual input data.
- "Failed to fetch image from URL": Check the URL accessibility and correctness.
- "Invalid base64 image content": Ensure the base64 string is properly encoded without extra characters.
- Compression errors: Try lowering the compression level or changing the output image type.
Enabling "Continue On Fail" in the node settings can help workflows proceed even if some items fail compression.