A powerful command-line tool for common image operations, built with Python. Supports batch processing, format conversion, and image resizing while maintaining quality.
- Format Conversion: Convert images between multiple formats (PNG, JPEG, GIF, WEBP, etc.)
- Image Downsizing: Downsize images with optional aspect ratio preservation
- Information Display: View detailed image metadata and properties
- Dual Interface:
- Interactive CLI with guided prompts
- Command-line arguments for scripting and automation
- PNG (with APNG support)
- JPEG/JPG
- GIF
- WEBP
- TIFF
- BMP
- And many more...
- Clone the repository:
git clone https://github.com/tahadnan/Image-Toolkit.git
cd image-toolkit
- Install dependencies:
pip install -r requirements.txt
Launch the interactive interface with guided prompts:
python image_toolkit.py -i
Available commands in interactive mode:
convert
: Transform image formatdownsize
: downsize image dimensionsinfo
: View image detailshelp
: Display help messageclear
: Clear screenexit
: Close program
python image_toolkit.py convert input_image.jpg png
# Preserve aspect ratio
python image_toolkit.py downsize input_image.jpg 800x600
# Force exact dimensions
python image_toolkit.py downsize input_image.jpg 800x600 -f
python image_toolkit.py info input_image.jpg
- Convert PNG to JPEG:
python image_toolkit.py convert image.png jpg
- downsize image to 1920x1080 (maintaining aspect ratio):
python image_toolkit.py downsize image.jpg 1920x1080
- Get image information :
python image_toolkit.py info image.gif
usage: image-toolkit [-h] [-i] {info,convert,downsize} ...
options:
-h, --help show this help message and exit
-i, --interactive Launch interactive mode with guided prompts
available commands:
valid operations
{info,convert,downsize}
info Displays the given image info
convert Convert image from one format to another
downsize Downsize image to specified dimensions
- Pillow (PIL Fork) - Image processing
- prompt_toolkit - Interactive CLI interface
- wcwidth - Terminal width calculations
The toolkit includes comprehensive error handling for:
- Invalid file paths
- Unsupported formats
- Invalid dimensions
- File permission issues
The program uses the following status indicators in CLI:
[+]
Success messages[-]
Error/warning messages[*]
Information display[>]
Operations/actions[?]
Help/questions[i]
Informational content
Contributions are welcome! Please feel free to submit a Pull Request.
Licensed under the MIT license