Crusher (Wikipedia):
Crushers may be used to reduce the size, or change the form, of waste materials so they can be more easily disposed of or recycled..."
Much like an actual crusher, pyCrusher copies your precious little images and turns them into absolute trash (for fun!)
pipx install pycrusher
uv tool install pycrusher
pip install pycrusher
git clone https://github.com/jonesmartins/pycrusher
cd pycrusher
python setup.py install
Type in the command line:
pycrusher <image_file> <flags and parameters>
As default, the program saves your output in a special directory called 'compressions' located at path/to/somewhere
, so if you use pyCrusher multiple times in path/to/somewhere
, you can check your compressed images without mixing it up between your other files.
Every time you save a new file in 'compressions', your output file will be saved with your input name followed by the compression settings. You can still use the -o/--output flag and name it however you want.
Default name: compression/<image-name>_i<iterations>e<extra><r><p><c>[colors].<extension>
usage: pycrusher [-h] [-i ITERATIONS] [-e EXTRA] [-c [COLORS ...]] [-o OUTPUT] [-r] [-p] file
positional arguments:
file Name of image to compress
options:
-h, --help show this help message and exit
-i ITERATIONS, --iterations ITERATIONS
Number of compression iterations
-e EXTRA, --extra EXTRA
Number of nested iterations
-c [COLORS ...], --colors [COLORS ...]
Color changes
-o OUTPUT, --output OUTPUT
Name of output file.
-r, --reverse Reverses compression iterations.
-p, --preprocess Adds color enhancement BEFORE compression.
Original image: crusher.png
pycrusher crusher.png
Default output filename: compressions/crusher_i50e1.png
pycrusher crusher.png -i 10
Default output filename: compressions/crusher_i10e1.png
pycrusher crusher.png -i 10 -e 5
Default output filename: compressions/crusher_i10e5.png
pycrusher crusher.png -i 20 -c 4
Default output filename: compressions/crusher_i20e1c[4.0].png
pycrusher crusher.png -i 20 -c 4 -r
Default output filename: compressions/crusher_i20e1rc[4.0].png
pycrusher crusher.png -i 20 -c 4 0
Default output filename: compressions/crusher_i20e1c[4.0,0.0].png
pycrusher crusher.png -i 20 -c 4 0 -p
Default output filename: compressions/crusher_i20e1pc[4.0,0.0].png
Apache License 2.0