Overview
The Edit Image+ node allows you to perform a wide range of image editing operations within your n8n workflows. It supports actions such as blurring, adding borders, compositing images, creating new images, cropping, drawing shapes, resizing, rotating, shearing, adding text, and making colors transparent. The node is highly flexible and can be used for tasks like preparing images for web use, generating dynamic graphics, watermarking, or automating image processing pipelines.
Practical examples:
- Automatically resize and compress user-uploaded images before saving them.
- Add watermarks or custom text overlays to images.
- Generate simple graphics (e.g., badges, banners) on the fly.
- Combine multiple images into one (compositing).
- Extract image metadata for cataloging or validation.
Properties
Below are the supported input properties relevant to the "Default" Resource and "Default" Operation:
Display Name | Type | Description |
---|---|---|
Property Name | string | Name of the binary property in which the image data can be found. |
Options | collection | Additional options for output formatting and file handling. |
Options (within the Options collection):
- File Name (
string
): File name to set in the binary data output. - Font Name or ID (
options
): The font to use when adding text. Choose from a list or specify an ID using an expression. (Relevant for text operations) - Format (
options
): Set the output image format. Supported values: bmp, gif, jpeg, png, tiff, webp. - Quality (
number
): Sets the compression level for jpeg, png, or tiff formats (0–100, where 100 is best quality).
Output
The node outputs an item with the following structure:
- json: Contains the original JSON data from the input item. If the operation is "Get Information", this field will include image metadata such as resolution and other properties.
- binary: Contains the processed image data under the property name specified by "Property Name". This includes:
data
: The binary image data (as a buffer).mimeType
: The MIME type of the output image (e.g.,image/png
,image/jpeg
).fileExtension
: The file extension corresponding to the chosen format.fileName
: The file name if specified in options.
If the node encounters an error and "Continue On Fail" is enabled, the output will contain an error
field in the json
object with the error message.
Dependencies
- External Libraries:
- gm (GraphicsMagick/ImageMagick): Used for image manipulation.
- tmp-promise: For temporary file handling during composite operations.
- get-system-fonts: To list available system fonts.
- System Requirements:
- GraphicsMagick or ImageMagick must be installed on the host machine.
- No API keys or external service credentials are required.
Troubleshooting
Common Issues:
- Missing Binary Data: If the specified "Property Name" does not exist in the input item's binary data, the node will throw an error.
- Invalid Format/Quality: Specifying an unsupported format or out-of-range quality value may result in errors or unexpected output.
- Font Not Found: When adding text, specifying a font that is not available on the system may cause the operation to fail or default to a standard font.
- GraphicsMagick/ImageMagick Not Installed: The node requires either GraphicsMagick or ImageMagick to be installed on the server. Missing these dependencies will cause all image operations to fail.
Error Messages:
"No binary data property '...' exists on item!"
: The input item does not have the expected binary property. Check the "Property Name" value."Error: ..."
: General errors from the underlying image library or file system. Review the error message for details; often related to invalid parameters or missing dependencies.
How to resolve:
- Ensure the correct binary property name is provided.
- Verify that the required system libraries (GraphicsMagick/ImageMagick) are installed and accessible.
- Use valid values for format and quality.
- Make sure any custom fonts are installed on the system if referenced.