Scale Image
Controlled node
Overview
The Scale Image node resizes an image by a specified scale factor using the Jimp image processing library. Unlike the Resize Image node which takes absolute pixel dimensions, this node uses a multiplier to scale the image proportionally.
Pass a factor of 0.5 to reduce the image to half its original size, or 2 to double the size. The scaling is applied uniformly to both width and height, maintaining the aspect ratio.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the image scaling operation. | - |
| Image | Data | The image to be scaled. Must be a valid Jimp image object. | - |
| Factor | Number | The scaling factor to apply. Values less than 1 shrink the image, values greater than 1 enlarge it. | 1 |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the scaling operation is complete. |
| Output | Data | The scaled image as a Jimp image object. |
Runtime Behavior and Defaults
When the node receives a Run event, it clones the input image and applies the scale factor using Jimp's scale() method. The original image is not modified; instead, a new scaled image is output.
The default factor is 1, meaning if no factor is provided, the image will be returned at its original size.
Example Usage
To create a thumbnail that is 50% of the original image size:
- Connect an image source (such as a Read Image node) to the Image input.
- Set the Factor input to
0.5(or connect a number node with value 0.5). - Trigger the Run event.
- The Output will contain the scaled-down image, which can then be passed to other image processing nodes or saved to the library using Write To Library.
To double the size of an image for high-resolution displays, use a factor of 2.