Rotate Image
Controlled node
Overview
The Rotate Image node rotates an image by a specified number of degrees. This node is useful for image preprocessing, correcting orientation, or creating visual effects in your workflows. It uses the Jimp image processing library to perform the rotation while preserving image quality and transparency.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the rotation operation. | - |
| Image | Data | The image to rotate. Accepts Jimp image objects from other image nodes or file inputs. | - |
| Degrees | Number | The number of degrees to rotate the image. Positive values rotate clockwise, negative values rotate counter-clockwise. | 0 |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the rotation is complete. |
| Output | Data | The rotated image as a Jimp object. |
Runtime Behavior and Defaults
When the Run event is triggered, the node takes the input image and rotates it by the specified number of degrees. The rotation is performed around the center of the image.
- Default rotation: If no degrees value is provided, the image is not rotated (0 degrees).
- Image format: The output maintains the same format and properties as the input image (e.g., JPEG, PNG, etc.).
- Transparency: If the input image has an alpha channel (transparency), the rotated output will preserve it.
- Canvas size: The output image dimensions may change to accommodate the rotated content, ensuring no part of the image is clipped.
Example
Here's a simple workflow that reads an image from the library, rotates it 90 degrees, and saves it back:
- Add a Read Image node and connect it to a file source to load an image.
- Connect the Output of the Read Image node to the Image input of the Rotate Image node.
- Set the Degrees input to
90(or connect a Number node with value 90). - Connect the Run event from a Start node or other trigger to the Run input of the Rotate Image node.
- Connect the Output of the Rotate Image node to a Write To Library node to save the rotated image.
[Start] --run--> [Read Image] --output--> [Rotate Image] --output--> [Write To Library]
^
|
[Number: 90]
Tip: For common rotations like 90°, 180°, or 270°, you can also use the Flip Image node for 180° rotations, which may be more performant.