Ticket #1576: optimize-images
File optimize-images, 443 bytes (added by , 13 years ago) |
---|
Line | |
---|---|
1 | #!/bin/sh |
2 | |
3 | for x in $(find images/ -name "*.png"); do |
4 | echo "Processing ${x}" |
5 | identify -quiet -verbose "${x}" | grep "alpha: 1-bit" > /dev/null |
6 | if [ "$?" -ne "0" ]; then |
7 | # non-1-bit-alpha image, process normally |
8 | optipng -o7 -quiet "${x}" |
9 | else |
10 | # disable color type reduction because that will break |
11 | # transparency for the images in JOSM using the current |
12 | # image loading method (see #1576) |
13 | optipng -nc -o7 -quiet "${x}" |
14 | fi |
15 | done |