Img-Tool is a versatile CLI tool designed to convert standard (baseline) JPEG images into progressive JPEGs. It streamlines the process of handling large batches of images, offering additional features like thumbnail creation, compression control, metadata management, and more.
Installation
To install the tool, simply run the following command:
pip install todo
Usage
After installation, you can start using JPEG Converter by executing:
jpeg-converter [OPTIONS] INPUT_PATH
Features
JPEG Converter comes with a variety of features to manage and optimize your JPEG images efficiently:
- Convert Baseline to Progressive JPEG: Easily convert single images or entire directories from baseline to progressive JPEG format.
- Batch Processing: Handle multiple images at once, with support for recursive directory traversal.
- Thumbnail Generation: Create thumbnails with various specifications, including cropping and resizing.
- Compression Control: Adjust compression levels to balance image quality and file size.
- Metadata Management: Remove EXIF metadata to protect privacy or embed custom copyright information.
Configuration
JPEG Converter can be configured using command-line options. Below is a table of available options:
| Option | Description |
|---|---|
--output-dir PATH |
Directory to save the output images. If not specified, original images will be overwritten after confirmation. |
--thumb TEXT |
Thumbnail specification. Formats: - WxH (e.g., 100x300) - Crop to WxH from center - WxHt (e.g., 100x300t) - Crop from top - WxHb (e.g., 100x300b) - Crop from bottom - WxHf (e.g., 100x300f) - Fit inside WxH without cropping - 0xH (e.g., 0x300) - Resize to height H, preserving aspect ratio - Wx0 (e.g., 100x0) - Resize to width W, preserving aspect ratio |
--thumb-dir PATH |
Directory to save thumbnails. Required when --thumb is used. |
--compress [low, medium, high] |
Compression level for the output images. |
--verbose |
Enable verbose output during processing. |
--recursive |
Process directories recursively, including subdirectories. |
--remove-metadata |
Remove EXIF metadata from images. |
--copyright-text TEXT |
Add copyright text to the image metadata. Note: Ignored if --remove-metadata is used. |
Examples
Examples
Basic Conversion
Convert a single image and overwrite the original after confirmation:
jpeg-converter path/to/image.jpg
Convert All Images in a Directory
Convert all JPEG images in a directory and save the outputs to another directory:
jpeg-converter path/to/input_directory --output-dir path/to/output_directory
Batch Conversion with Compression and Metadata Removal
Convert all images with high compression and remove EXIF metadata:
jpeg-converter path/to/input_directory --compress=high --remove-metadata
Create Thumbnails
Create thumbnails with center cropping:
jpeg-converter path/to/input_directory --thumb=100x300 --thumb-dir path/to/thumbnails/
Combine Multiple Options
Convert images, create thumbnails, set compression level, enable verbose output, process directories recursively, and add copyright:
jpeg-converter path/to/input_directory \
--output-dir path/to/output_directory \
--thumb=150x150f \
--thumb-dir path/to/thumbnails/ \
--compress=medium \
--recursive \
--verbose \
--remove-metadata \
--copyright-text="© 2024 Your Name"
License
Distributed under the MIT License. See LICENSE for more information.
Metadata
Release files for jpegger 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jpegger-1.0.0.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jpegger-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / jpegger-1.0.0.tar.gz
| Download URL | jpegger-1.0.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2b182719cf93345a2cf3370241858531da268add680a519d64aad30b371813
|
|
BLAKE2b-256 checksum How to use checksums |
a09e016a6b9c31a488bdb422883751f34ee979bb294de07c1891d9d511ace56e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0
|
Release files / jpegger-1.0.0-py3-none-any.whl
| Download URL | jpegger-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
530633ffdbb28c428b5489497b63d6d3862ca220482c382c11264de2b3f50a1d
|
|
BLAKE2b-256 checksum How to use checksums |
b8b23eea33b92e95db5fed5d7cbd21365ade6e5dcca3e9aba75a9fa89276152d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0
|