Productivity
image-rotator avatar

image-rotator

Reliably rotate images by 90-degree increments using a deterministic Python script. Supports PNG, JPG, GIF, BMP, and TIFF, preserving quality with automated file handling.

Introduction

The image-rotator skill provides a deterministic, reliable, and reproducible way to manipulate image orientation. Designed for journalists, data analysts, and automated workflows, it eliminates the inconsistency of manual image editing or ad-hoc script generation. By utilizing a standardized Python script powered by the Pillow (PIL) library, this skill ensures that image quality is maintained while supporting batch processing and specific rotation angles. It is intended for users who need to fix image orientations, align documents, or prepare image datasets for presentations or reporting. The skill operates by taking an input image file and performing a precise rotation operation, with options to specify rotation direction and frequency, effectively standardizing the image manipulation workflow.

  • Precise 90-degree, 180-degree, and 270-degree rotation capabilities.

  • Support for major image formats including PNG, JPG, JPEG, GIF, BMP, and TIFF.

  • Intelligent handling of aspect ratios and cropping using PIL's expand functionality.

  • Batch processing support, allowing users to rotate multiple images in a single workflow execution.

  • Deterministic behavior: uses a verified script, preventing the hallucinations or varying quality often found in generative code snippets.

  • Input requirements: Provide a valid file path to the source image; the tool accepts common image extensions.

  • Workflow integration: When a user requests a rotation, verify the file existence, determine the rotation requirement (default is 90 degrees clockwise), and execute the bundled script.

  • Customization: Supports output path specification and counter-clockwise rotation parameters via command-line arguments.

  • Prerequisites: Ensures the environment has the Pillow library installed via uv or pip.

  • Error handling: The script includes validation to handle missing files or unsupported file formats, returning clear messages if the operation fails.

  • Metadata preservation: Designed to maintain original file metadata where possible during the transformation process.

Repository Stats

Stars
19
Forks
6
Open Issues
0
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 07:47 PM
View on GitHub