A simple Python command-line tool for converting and compressing image files using Pillow.
It supports many common image formats and provides sensible default compression settings that can significantly reduce file size with little or no visible quality loss.
Install Pillow before using the tool:
pip install pillowThe tool supports two actions: convert and compress.
Convert an image to a different format.
python image_tool.py convert -f input.webp -e png -o output.pngCompress an image using default settings that reduce file size with minimal or no visible quality loss.
python image_tool.py compress -f input.pngIf no output file is provided, the tool will automatically create one using _compressed.
You can also specify a custom output file:
python image_tool.py compress -f input.jpg -o input_small.jpgenjoy