A small Python tool that batch-edits images: it corrects EXIF-based orientation, sharpens the image, and boosts contrast, then writes the results to an output directory.
- EXIF orientation correction - rotates images according to their EXIF orientation tag and resets the tag afterwards, so the result displays correctly everywhere instead of being rotated twice by orientation-aware viewers.
- Sharpening via an unsharp mask filter, with configurable radius, percent, and threshold.
- Contrast enhancement with a configurable factor.
- Batch processing of an entire directory, skipping unsupported files and continuing past unreadable ones instead of aborting the run.
- Composable pipeline - each edit is a small step implementing a common interface, so new steps (e.g. resizing, watermarking) can be added without touching existing code.
pip install -r requirements.txtOr install as a package (adds an imageeditor command):
pip install .Run over the bundled sample images:
python -m imageeditor.cliOr, with custom options:
python -m imageeditor.cli \
--input-dir path/to/images \
--output-dir path/to/output \
--contrast 1.3 \
--sharpen-radius 2.5 \
--sharpen-percent 175 \
--sharpen-threshold 3Run python -m imageeditor.cli --help for the full list of options.
src/imageeditor/
editor.py - core pipeline: EditStep protocol, SharpenStep,
ContrastStep, ExifOrientationCorrector, BatchImageEditor
cli.py - command-line entry point
tests/
test_editor.py
examples/sample_images/
sample stock images used to try the tool out
Each edit is a small object implementing an EditStep protocol
(apply(image) -> image). BatchImageEditor takes a list of steps and
applies them in order to every supported image in a directory. This keeps
each transformation independent and testable, and makes it straightforward
to add new steps or reorder existing ones without changing the batch
processing logic.
pip install -e ".[dev]"
pytestThe images in examples/sample_images/ are royalty-free stock photos
included only to demonstrate the tool; they contain no personal or
identifying metadata.