Skip to content

Instantly share code, notes, and snippets.

@aotd1
aotd1 / crushimg.sh
Created April 10, 2018 06:26 — forked from caiguanhao/crushimg.sh
Recursively crush/shrink/optimize/losslessly compress PNGs, JPEGs and GIFs.
#!/bin/bash
# This is an improved script of pngfix.sh (https://gist.github.com/404909)
# which can also crush/shrink/optimize/losslessly compress JPEGs and GIFs.
# It is recommended you backup your image files before executing this script.
# Operation will be skipped if output file is bigger in size.
#
# use chmod +x crushimg.sh to make it executable and then ./crushimg.sh to run, or
# bash ./crushimg.sh to run it directly
#
# ./crushimg.sh [FILE] - (default to current directory)