Grayscale Image
Converts a color image to grayscale by removing color information while preserving luminance.
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 color image file.
- Out Path - Path where the grayscale output image will be saved.
Options
This node does not have any configurable options.
Output
- result - Boolean indicating success or failure of the grayscale conversion operation.
How It Works
The Grayscale Image node uses ImageMagick library to convert color images to grayscale. When executed, the node:
- Validates input and output file paths
- Loads the specified input image
- Applies the grayscale conversion algorithm which converts each pixel to a shade of gray based on its luminance
- Saves the resulting grayscale 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
- Grayscale conversion preserves image details while removing color information
- The conversion uses a standard luminance calculation that properly weights the red, green, and blue channels
- File size may be reduced after conversion, especially for images with simple color palettes
- Grayscale images are often used for:
- Document processing
- OCR applications
- Reducing computational complexity in image analysis
- Creating consistent visual styles
- Processing is generally fast as it's a straightforward pixel transformation
- The output image will have the same dimensions as the input image
- Metadata and other image properties are preserved during the conversion