Skip to content

Commit

Permalink
Make use of pngcrush to strip PNG files (via new script)
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Marier committed Dec 22, 2013
1 parent 55fc638 commit a789007
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion optimize_images
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# TODO: pngcrush -q -rem gAMA -rem alla -rem text {}.png {}.crushed.png
find . -iname '*.png' -exec pngstripper {} \;
find . -iname '*.png' -exec optipng -o9 -q {} \;
find . -iname '*.png' -exec advpng -z -4 -q {} \;
find . -iname '*.gif' -exec gifsicle -O2 -b {} \;
Expand Down
13 changes: 13 additions & 0 deletions pngstripper
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Strips non-essential parts of PNG images using pngcrush
#

if [ "z$1" = "z" ] ; then
echo "Usage: `basename $0` file1.png [ file2.png [ file3.png ... ] ]"
exit 1
fi

for f in $* ; do
pngcrush -q -rem gAMA -rem alla -rem text $f $f.crushed && mv $f.crushed $f
done

0 comments on commit a789007

Please sign in to comment.