source: josm/trunk/optimize-images@ 6101

Last change on this file since 6101 was 4939, checked in by xeen, 13 years ago

add shell script that compresses all PNGs

Requires ImageMagick and optipng to be installed and available in $PATH.
Works around bug which causes PNGs with 1-bit-alpha-channels to have an
opaque background (see #1576)

  • Property svn:executable set to *
File size: 443 bytes
Line 
1#!/bin/sh
2
3for 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
15done
Note: See TracBrowser for help on using the repository browser.