3
# This script needs imagemagick (apt-get install imagemagick)
5
# Copyright (C) 2010 Francois Marier <fmarier@gmail.com>
7
# Copying and distribution of this file, with or without modification,
8
# are permitted in any medium without royalty provided the copyright
9
# notice and this notice are preserved. This file is offered as-is,
10
# without any warranty.
12
if [ "z$1" = "z" -o "z$2" = "z" ] ; then
13
echo "Usage: $0 <original_image> <output_extension>"
14
echo " (e.g. $0 nobody.png png)"
21
for s in {1..512} ; do
22
convert $ORIG_IMAGE -resize ${s}x${s} ${s}.$EXTENSION
24
# Make sure all files are losslessly optimized
25
if [ "$EXTENSION" = "png" ] ; then
26
optipng -q ${s}.$EXTENSION
27
elif [ "$EXTENSION" = "jpg" ] ; then
28
jpegoptim -q -p --strip-all ${s}.$EXTENSION