Rotate / flip image
image_rotateRotate images by any angle and flip them horizontally or vertically, with EXIF orientation correction to fix sideways phone photos before saving as JPEG, PNG, WebP, or AVIF.
Instructions
Rotate an image clockwise by 90, 180, 270 or any angle (the canvas grows to fit; new corners get background), and/or flip it horizontally (mirror) or vertically. Flips apply after the rotation, as seen on screen. EXIF orientation is applied first (autoOrient, default on), so with angle 0 this simply "fixes" sideways phone photos. Output JPEG/PNG/WebP/AVIF ("keep" = same as input), name -rotated.. Web version: https://s3eidat.github.io/photo-filters/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| angle | No | Clockwise rotation in degrees (negative = counter-clockwise). Default 90. | |
| image | Yes | The image: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI). | |
| format | No | Output format. Default keep (JPEG/PNG/WebP stay, others become PNG). | keep |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| quality | No | Quality 1-100 for JPEG / WebP / AVIF (ignored for PNG). Default 92, same as the website. | |
| autoOrient | No | Apply the EXIF Orientation tag first (what browsers show). Default true. | |
| background | No | Fill for the corners uncovered by a non-right-angle rotation. Default transparent (white in JPEG). | #00000000 |
| flipVertical | No | Mirror top-bottom (after rotating). | |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. | |
| flipHorizontal | No | Mirror left-right (after rotating). |