Edit Image+

Edits an image like blur, resize or adding border and text

Overview

The Edit Image+ node's "Border" operation adds a border to an image. This is useful for visually highlighting images, creating thumbnails with frames, or preparing images for presentations and social media. For example, you might use this node to add a colored frame around product photos before uploading them to an e-commerce site.

Properties

Below are the input properties relevant to the "Border" operation:

Display Name Type Description
Property Name String Name of the binary property in which the image data can be found.
Border Width Number The width of the border (in pixels).
Border Height Number The height of the border (in pixels).
Border Color Color Color of the border (hex code, e.g., #000000 for black).
Options Collection Additional options:
- File Name String File name to set in the output binary data.
- Format Options Output image format (bmp, gif, jpeg, png, tiff, webp).
- Quality Number Compression level for jpeg, png, or tiff formats (0–100).

Output

  • json: Contains the original JSON data from the input item.
  • binary: The processed image with the added border is returned in the specified binary property (as defined by "Property Name").
    • The binary field includes:
      • data: The image file data (with the border applied).
      • mimeType: MIME type corresponding to the selected format (e.g., image/png).
      • fileExtension: File extension based on the chosen format.
      • fileName: If provided, the custom file name; otherwise, inherited or generated.

If the input contained other binary fields, they are preserved in the output.

Dependencies

  • External Libraries: Uses GraphicsMagick via the gm npm package for image processing.
  • n8n Requirements: No special environment variables required for the "Border" operation.
  • Binary Data: The input item must contain valid binary image data in the specified property.

Troubleshooting

Common Issues:

  • Missing Binary Data:
    Error message: "No binary data property '...' exists on item!"
    Resolution: Ensure the input item contains the correct binary property as specified in "Property Name".

  • Invalid Image Format:
    Error message: "Input buffer contains unsupported image format"
    Resolution: Make sure the input image is in a supported format (e.g., PNG, JPEG).

  • Incorrect Property Names:
    Error message: "Cannot read property '...' of undefined"
    Resolution: Double-check that all property names match those in your workflow and input data.

  • File Name/Format Mismatch:
    If you specify a file name with an extension that doesn't match the selected format, the node will adjust the extension automatically.

Links and References

Discussion