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 compression operation that reduces the file size of images while maintaining acceptable quality. It supports multiple input methods for the image, including binary data from a previous node, base64 encoded strings, or direct URLs to image files. Users can specify output format and compression level, making it useful for optimizing images before storage, transmission, or display in web applications.
Common scenarios include:
- Compressing user-uploaded images to reduce bandwidth usage.
- Preparing images for faster loading on websites or mobile apps.
- Reducing storage costs by compressing large image files.
- Automating image optimization workflows in content management systems.
Example: A workflow receives images as binary data from an upload node, compresses them to JPG with medium compression, and outputs smaller images ready for publishing.
Properties
| Name | Meaning |
|---|---|
| Input Image Data Type | How the image is provided: "Binary Data" (from previous node), "Base64 String", or "URL". |
| Input Binary Field | Name of the binary property containing the image file (used if Input Image Data Type is Binary). |
| Base64 Image Content | Base64 encoded string of the image content (used if Input Image Data Type is Base64). |
| Image URL | URL pointing to the image file (used if Input Image Data Type is URL). |
| Output File Name | Desired filename for the compressed image output (e.g., "compressed_image.jpg"). |
| Image Type | Output image format: "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 a customizable binary property name (default "data"). The JSON output contains metadata about the processed item, but the main payload is the compressed image binary data suitable for further processing or saving.
If the input was binary data or base64, the output will be the compressed image binary. If the input was a URL, the node downloads, compresses, and outputs the compressed image binary.
Dependencies
- Requires internet access if using image URLs.
- No explicit external API keys or credentials are indicated in the source code.
- Compression logic is handled internally or via bundled dependencies (not shown explicitly).
- No special environment variables or n8n configurations appear necessary.
Troubleshooting
- Invalid Input Data: Providing an incorrect binary property name or malformed base64 string may cause errors. Ensure the input matches the selected input type.
- Unsupported Image URLs: URLs must point directly to accessible image files; redirects or protected URLs may fail.
- Compression Errors: Extremely large images or unsupported formats might cause failures.
- Output Naming Conflicts: Using duplicate binary data output names in the workflow could overwrite data unintentionally.
Common error messages likely relate to invalid input data or network issues when fetching images from URLs. To resolve, verify input correctness and URL accessibility.