Composite Image
Controlled node
Overview
The Composite Image node overlays one image onto another at a specified position. This is useful for adding watermarks, logos, annotations, or combining multiple images into a single composition. The node takes a base image and overlays a source image at the specified X and Y coordinates.
This node is part of the image processing suite and requires a valid Jimp image object as input. Use the Read Image node or AI Generate Image node to create compatible image inputs.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the node to execute. | - |
| Image | Data | The base image to composite onto. Must be a valid Jimp image object. | - |
| Src | Data | The source image to overlay on top of the base image. Must be a valid Jimp image object. | - |
| X | Number | The horizontal position (in pixels) where the top-left corner of the source image will be placed. | 0 |
| Y | Number | The vertical position (in pixels) where the top-left corner of the source image will be placed. | 0 |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the image compositing is complete. |
| Output | Data | The resulting composite image (Jimp object). Returns null if inputs are invalid. |
Runtime Behavior and Defaults
When the Composite Image node runs, it first clones the base image to preserve the original. It then composites the source image (src) onto the base image at the specified coordinates (x, y).
- Coordinate System: The X and Y coordinates represent the top-left corner of the source image relative to the top-left corner of the base image (0,0).
- Blending: The source image is placed on top of the base image using standard alpha compositing. Transparent areas in the source image will allow the base image to show through.
- Bounds: The source image can be positioned partially or fully outside the bounds of the base image. Only the overlapping region will be visible in the output.
- Error Handling: If either the
imageorsrcinputs are not valid Jimp image objects, the node outputsnull.
Example Usage
Adding a Watermark
Connect an image loaded via Read Image to the image input, and a logo or watermark image to the src input. Set x and y to position the watermark (e.g., bottom-right corner):
X: {{image.width - watermark.width - 20}}
Y: {{image.height - watermark.height - 20}}
Creating a Collage
Use multiple Composite Image nodes in sequence to layer several images together. For example:
- First node: Composite a background image with a photo at (0, 0)
- Second node: Take the output and composite another photo at (200, 0)
- Third node: Take the output and composite a border or frame
Dynamic Positioning
Use the Image Size node to get dimensions of the base image, then use a Formula node to calculate centered positions:
X: (baseWidth - overlayWidth) / 2
Y: (baseHeight - overlayHeight) / 2