Resize Image
Controlled node
Overview
The Resize Image node resizes an image to specified dimensions using the Jimp image processing library. It supports both exact resizing (which may distort the aspect ratio) and aspect-ratio-preserving scaling that fits the image within the specified bounds.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the image resizing operation | - |
| Image | Data | The image object to resize (Jimp image) | - |
| Width | Number | Target width in pixels | Original image width |
| Height | Number | Target height in pixels | Original image height |
| Preserve Aspect | Boolean | When enabled, scales the image to fit within the specified dimensions while maintaining the original aspect ratio | false |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the resize operation is complete |
| Output | Data | The resized image object |
Runtime Behavior and Defaults
- If Width or Height inputs are not provided or connected, the node defaults to the original dimensions of the input image
- When Preserve Aspect is enabled, the node uses
scaleToFitwhich scales the image proportionally to fit entirely within the specified width and height. The resulting image maintains its aspect ratio and may be smaller than the specified dimensions in one axis. - When Preserve Aspect is disabled, the node uses
resizewhich stretches or compresses the image to exactly match the specified width and height, potentially distorting the aspect ratio - The node creates a clone of the original image before processing, leaving the input image unchanged
Example Usage
To resize an image to a thumbnail while maintaining quality:
- Use a Read Image node to load an image from the library
- Connect the image output to the Resize Image node's Image input
- Set Width to
200and Height to200in the properties panel (or connect Number nodes) - Enable Preserve Aspect to ensure the thumbnail maintains proportions
- Trigger the Run event from a Start node or other event
- The Output will contain the resized image, which can be passed to Write To Library or other image processing nodes