Invert Image Colors
Inverts the colors of an image by negating each pixel value, creating a "negative" effect.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- In Path - Path to the input image file.
- Out Path - Path where the color-inverted output image will be saved.
Options
This node does not have any configurable options.
Output
- result - Boolean indicating success or failure of the color inversion operation.
How It Works
The Invert Image Colors node uses ImageMagick library to create a negative of the input image by inverting all pixel values. When executed, the node:
- Validates input and output file paths
- Loads the specified input image
- Applies the negate operation which inverts each pixel's color values
- Saves the resulting inverted image to the output path
Requirements
- Valid input image file at the specified path
- Output path must be writable
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid input file path
- Input file not found at the specified path
- Empty or invalid output file path
Usage Notes
- Each pixel's color values are inverted (RGB values are subtracted from their maximum value)
- White becomes black, black becomes white, and all other colors are inverted accordingly
- Works with all image formats supported by ImageMagick
- Processing is generally fast as it's a straightforward pixel transformation
- Useful for:
- Creating artistic effects
- Enhancing contrast in certain types of images
- Preparing images for certain types of image analysis
- Creating negatives for film simulation effects
- The output image will have the same dimensions and format as the input image (unless specified otherwise in the output path)
- Metadata is preserved during the inversion process
- This operation is lossless and can be reversed by applying the same operation again