Skip to main content

Rotate Image in n8n

Rotate Image is an n8n module by PDF4me that rotates an image by a precise angle in one workflow step. Send the image as binary data, Base64, or a URL, set a rotation angle from 0 to 360 degrees, choose a background fill color, and receive the rotated file.

What this node does

PDF4me: Rotate Image rotates a JPG, PNG, GIF, or BMP image by any angle in one n8n step. Set Rotation Angle in degrees, Background Color to fill any area exposed by the rotation, and Proportionate Resize to keep the aspect ratio. Accepts input via Binary Data, Base64 String, or URL. Ideal for orientation correction, photo standardization, and content preparation workflows.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate image-rotation requests securely.

Important Facts You Should Not Miss

Any angle, not just 90-degree presets
Rotation Angle accepts any value from 0 to 360 degrees, so you are not limited to quarter-turn rotations. Positive values rotate clockwise.
Background Color fills exposed corners
Rotating by an angle that is not a multiple of 90 degrees exposes empty corner areas outside the original image. Background Color, white by default, fills that space with the hex color you choose.
Proportionate Resize controls output dimensions
On, the default, adjusts dimensions to preserve the aspect ratio and prevent distortion. Off keeps the original canvas size, which can crop content on non-90-degree rotations.
Rotate Image n8n node configured with Credential PDF4ME account, Action Rotate Image, Input Data Type Base64 String, Base64 Image Content, Output File Name rotate_image_output.png, Background Color hex FFFFFF, Proportionate Resize toggle on, Rotation Angle 90, Async toggle off, and Binary Data Output Name data

Full node panel: image via Base64 String, 90-degree rotation with white background fill

Parameters

Required in the n8n UI: Input Data Type and Rotation Angle. Output File Name (default rotate_image_output.png), Background Color (default #FFFFFF), Proportionate Resize, Async, and Binary Data Output Name (default data) are optional. Conditional source fields (Input Binary Field, Base64 Image Content, Image URL) appear only when their matching Input Data Type is chosen.

ParameterRequiredWhat it doesExample
Input Data TypeRequiredHow the source image enters the node. Binary Data reads from a previous node (default, most common). Base64 String accepts an encoded image. URL downloads it from a public link.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the image. Required when Input Data Type is Binary Data.data
Base64 Image ContentConditionalBase64-encoded image content (.jpg, .png, .gif, .bmp). Required when Input Data Type is Base64 String./9j/4AAQSkZJRgAB...
Image URLConditionalPublicly reachable URL to the image file. Required when Input Data Type is URL.https://abc.com/photo.jpg
Output File NameOptionalFilename of the rotated image returned by the node. Default is rotate_image_output.png.rotate_image_output.png
Background ColorOptionalHex color code used to fill areas exposed during rotation. Default is #FFFFFF (white).#FFFFFF
Proportionate ResizeOptionalToggle to maintain proportional dimensions during rotation, preventing distortion. On by default.On
Rotation AngleRequiredRotation angle in degrees, 0 to 360. Positive values rotate clockwise.90
AsyncOptionalToggle background processing for large images or non-time-critical jobs. Off by default.Off
Binary Data Output NameOptionalName of the binary property the output item exposes. Default is data.data

What Fields Does the Output Include?

FieldTypeWhat it contains
successBooleanTrue when the rotation completed successfully. Use to route error-handling branches.
messageStringDescriptive status message confirming success or describing an error.
fileNameStringFilename of the rotated image, set from Output File Name.
mimeTypeStringMIME type of the output image, for example image/png.
fileSizeNumberSize of the rotated image file in bytes.
rotationAngleNumberThe actual rotation angle that was applied, useful for tracking and verification.
Binary (data)BinaryThe rotated image file under Binary Data Output Name (default data). Pass into Write Binary File, Email, or any storage upload.

How Do I Set Up Rotate Image in n8n?

  1. Add PDF4me to your n8n workflow and set Action to Rotate Image.
  2. In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
  3. Set Input Data Type to Binary Data (default), Base64 String, or URL and fill the matching field.
  4. Enter Rotation Angle in degrees, 0 to 360.
  5. Optionally set Background Color to control the fill for areas exposed by the rotation, and toggle Proportionate Resize to preserve the aspect ratio.
  6. Optionally change Output File Name from the default rotate_image_output.png and Binary Data Output Name from the default data.
  7. Execute the node and route the rotated image into Write Binary File, Email, or cloud storage.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using Rotate Image.
Mobile upload orientation fix
  1. A webhook receives a photo uploaded from a mobile device (Binary Data, property data).
  2. PDF4me Rotate Image runs with Rotation Angle set based on the detected orientation issue.
  3. The corrected image is saved to a shared photo gallery folder.
Scanned document straightening for OCR
  1. A Read Binary File node loads a batch of scanned document images from a network folder.
  2. PDF4me Rotate Image is configured with a small corrective angle and Background Color set to white to prepare each scan for accurate OCR.
  3. The corrected images are passed into a downstream OCR or text-extraction step.
Consistent orientation for a product catalog
  1. An HTTP Request node downloads a supplier product image from a URL.
  2. PDF4me Rotate Image runs with Input Data Type URL and Proportionate Resize on to standardize orientation without distorting the product photo.
  3. The standardized image is uploaded to the catalog's image storage bucket.

Practical Tips

Set Background Color to match your destination
For product photos or documents going onto a white page, keep the default #FFFFFF. For dark-themed use cases, set a matching hex color so exposed corners blend in.
Non-90-degree angles expose corners
Only rotations at exactly 0, 90, 180, or 270 degrees avoid exposing background-filled corners. Any other angle will show the Background Color in the newly exposed areas.
Keep Proportionate Resize on to avoid distortion
Turning it off keeps the original canvas dimensions, which can crop parts of the image on non-90-degree rotations. Leave it on unless you specifically need a fixed output size.
If you already know the EXIF orientation, use the EXIF variant
When photos already carry EXIF orientation metadata, Rotate Image By EXIF Data can auto-correct them without you specifying a manual angle.
Enable Async for large batches
Turning Async on lets larger images or higher-volume rotation jobs process in the background instead of blocking the workflow synchronously.
rotationAngle in the output confirms what was applied
Log this field alongside your processing records, especially in batch jobs, to confirm each image received the intended rotation.

Cheat Sheet

FieldValue
ActionRotate Image
Input Data TypeBase64 String
Base64 Image Content/9j/4AAQSkZJRgAB...
Output File Namerotate_image_output.png
Background Color#FFFFFF
Proportionate ResizeOn
Rotation Angle90
AsyncOff
Binary Data Output Namedata
CredentialsPDF4me API credential

Frequently Asked Questions

How do I rotate an image in n8n?+
Add the PDF4me node, set Action to Rotate Image, provide the image as Binary Data, Base64, or URL, and set Rotation Angle in degrees. The node returns the rotated image, ready to pass into the next workflow step.
What rotation angles does this action support?+
Any angle from 0 to 360 degrees, not just the common 90, 180, and 270 degree presets. Positive values rotate clockwise.
What happens to the corners when I rotate an image that is not a multiple of 90 degrees?+
Rotating by an angle other than 0, 90, 180, or 270 degrees exposes empty corner areas outside the original image bounds. Background Color fills those areas with the hex color you specify, white by default.
Does rotating an image change its dimensions?+
It can. Proportionate Resize, when on, adjusts the output dimensions to preserve the aspect ratio and avoid distortion. Off keeps the original canvas size, which may crop or add more background fill depending on the angle.
What is the difference between Rotate Image and Rotate Image By EXIF Data?+
Rotate Image applies a manual angle you specify. Rotate Image By EXIF Data instead reads the orientation metadata embedded in the photo by the camera or phone and auto-corrects it, useful when you do not know the exact angle needed.

Same Task on Other Platforms

Use Cases

Photography and Image Orientation Correction

  • Automatically correct orientation issues from mobile devices and digital cameras that capture images in incorrect orientations
  • Process batch uploads of user-generated content to ensure consistent orientation across photo galleries and portfolios
  • Standardize image orientations for professional photography workflows and client deliverables

Document Processing and Digital Asset Management

  • Rotate scanned documents and images to proper reading orientation for OCR processing and archival systems
  • Automate the correction of misoriented images in bulk document processing workflows for improved readability
  • Standardize image orientations in content management systems and digital asset libraries for consistent presentation

Web Content and Social Media Optimization

  • Automatically orient images for optimal display across different platforms and device orientations
  • Process user-uploaded images for social media platforms that have specific orientation requirements
  • Create standardized image orientations for responsive web design and mobile application interfaces

Get Help