Skip to content

Instantly share code, notes, and snippets.

View peasant98's full-sized avatar

Matt Strong peasant98

View GitHub Profile
@peasant98
peasant98 / image-minifier.sh
Created December 15, 2019 20:38 — forked from dawsbot/image-minifier.sh
Lossless image compression for all images in current directory
#!/bin/bash
# Minify all jpg and png images in current directory recursively
command_exists () {
type "$1" &> /dev/null ;
}
if command_exists optipng ; then
optipng **/*.png
else
echo 'Error: optipng is not installed. If you are on a Mac, we recommend googling "homebrew Mac" and installing via brew' >&2