Scale Image
Scales an image by a specified percentage, maintaining the original aspect ratio.
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.
- Percentage - Scaling percentage for the image. Must be greater than zero. Values less than 100 shrink the image, values greater than 100 enlarge it.
- Out Path - Path where the scaled output image will be saved.
Options
This node does not have any configurable options.
Output
- result - Boolean indicating success or failure of the scaling operation.
How It Works
The Scale Image node uses ImageMagick library to proportionally resize an image by a specified percentage. When executed, the node:
- Validates input and output file paths
- Validates that the percentage value is greater than zero
- Loads the specified input image
- Applies the scaling transformation using the specified percentage
- Saves the scaled image to the output path
Requirements
- Valid input image file at the specified path
- Output path must be writable
- Percentage value must be a positive integer
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
- Percentage value less than or equal to zero
- Empty or invalid output file path
Usage Notes
- The aspect ratio is always preserved during scaling
- Common percentage values:
- 50 for half size
- 100 for original size
- 200 for double size
- Processing time depends on the scaling factor and image size
- Image quality may be affected when significantly enlarging images
- Useful for:
- Creating thumbnails
- Reducing file sizes
- Preparing images for different display requirements
- Maintaining consistent relative sizes across multiple images
- The output image format is determined by the file extension in the Out Path
- Metadata is generally preserved during scaling
- For best results when upscaling, consider using specialized upscaling algorithms not available in this node