1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

images → Mask an Image with Another Image

AI-generated

Overview

This node allows you to mask one image with another, using the "Mask an Image with Another Image" operation under the "images" resource. It is useful for scenarios where you want to apply a mask (such as a shape or transparency pattern) to an image, for example:

  • Creating profile pictures with custom shapes.
  • Applying branded overlays or watermarks.
  • Generating images with specific cutouts for design or automation purposes.

Practical Example:
You have a user-uploaded photo and want to crop it into a circular avatar using a circle-shaped mask image.

Properties

Name Meaning
X coordinate The horizontal position from the top left corner where the mask will be applied. Defaults to 0.
Y coordinate The vertical position from the top left corner where the mask will be applied. Defaults to 0.
Source image Image to be masked. This is the main image that will receive the mask.
Mask image Image to be used as the mask. Defines the shape/area to keep in the source image.
Binary Property Name of the binary property to which the resulting masked image data will be written.

Output

  • Binary Data:
    The output is a binary file containing the masked image. The binary property name is defined by the "Binary Property" input.
    • The output includes the original JSON fields and any existing binary data, with the new masked image added under the specified binary property name.
    • The binary data contains the processed image file, with filename and content type set according to the result.

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Environment: No additional environment variables are required beyond standard n8n configuration.

Troubleshooting

  • Common Issues:

    • Missing Binary Data: If the source or mask image is not provided as binary data, the node may fail or produce unexpected results.
    • Invalid File Types: Ensure both images are valid and supported formats (e.g., PNG, JPEG).
    • Incorrect Binary Property Name: If the "Binary Property" does not match the expected value, the output may not be accessible in subsequent nodes.
  • Error Messages:

    • "error": "Cannot read property 'fileName' of undefined": Indicates missing or misnamed binary input properties.
      • Resolution: Check that your input items contain the correct binary properties and that their names match what you specify in the node.
    • "error": "Request failed with status code 401": Authentication error.
      • Resolution: Verify your 1001fx API credentials in n8n.

Links and References

Discussion