Logo Overlay

Place logos on images and videos

Overview

This node, named "Logo Overlay," allows users to place a logo image onto another image or video file. It supports both local file paths and URLs for the input files. The node is useful in scenarios such as branding images or videos by adding watermarks, logos, or other overlays automatically within an automation workflow.

Practical examples include:

  • Adding a company logo to product photos before publishing.
  • Watermarking marketing videos with a brand logo.
  • Batch processing media files to ensure consistent branding.

The node handles resizing the logo optionally and positioning it at specified X and Y pixel coordinates on the target media.

Properties

Name Meaning
File Path Path or URL to the input image or video file where the logo will be placed (required).
File Type Type of the input file; options are Image or Video (required).
Logo Path Path or URL to the logo image file (PNG with transparency recommended) (required).
X Position Horizontal pixel coordinate for placing the logo on the input file (required).
Y Position Vertical pixel coordinate for placing the logo on the input file (required).
Logo Width (Optional) Width in pixels to resize the logo to; set to 0 to keep original width.
Logo Height (Optional) Height in pixels to resize the logo to; set to 0 to keep original height.

Output

The node outputs a JSON object containing:

  • base64: A base64-encoded string of the resulting image or video file with the logo overlay applied.
  • originalFile: The original input file path or URL.
  • logoFile: The logo file path or URL used.
  • position: An object with x and y properties indicating the logo's placement coordinates.
  • fileType: The type of the processed file, either "image" or "video".

If an error occurs during processing and the node is configured to continue on failure, the output JSON will contain an error field with the error message.

Dependencies

  • Requires the following Node.js packages bundled with the node:

    • Image processing: jimp
    • Video processing: fluent-ffmpeg
    • File system operations: fs-extra
    • HTTP/HTTPS modules for downloading files from URLs
    • Temporary file handling via OS temp directory
    • UUID generation for unique temporary filenames
  • The node expects that FFmpeg is installed and accessible in the environment for video processing.

  • No internal credential types are required, but the node needs internet access if URLs are used for input or logo files.

Troubleshooting

  • Common issues:

    • File not found errors if local paths do not exist.
    • Download failures due to invalid URLs or network issues.
    • FFmpeg errors if FFmpeg is not installed or misconfigured.
    • Unsupported file type errors if the File Type property is set incorrectly.
  • Error messages and resolutions:

    • "File not found: <path>": Verify the local file path exists and is accessible.
    • "Failed to download file: HTTP <statusCode>": Check the URL validity and network connectivity.
    • "Download timeout after 30 seconds": Network may be slow or unresponsive; try again or use a local file.
    • "Error processing image: <message>": Input image or logo might be corrupted or unsupported format.
    • "Error processing video: <message>": Ensure FFmpeg is installed and the input video is valid.
    • "Unsupported file type: <type>": Use only "image" or "video" as file type values.
  • To avoid temporary file clutter, the node attempts to clean up downloaded and generated temp files automatically.

Links and References

Discussion