Created
October 2, 2011 22:18
-
-
Save gerardpaapu/1258044 to your computer and use it in GitHub Desktop.
Make an 8-bit png and strip the gamma headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| filename=$(basename $1) | |
| outputdir=$(dirname $1) | |
| tempdir=$(mktemp -d -t 'png') | |
| tempfile1="$tempdir/$filename" | |
| tempfile2=$(mktemp -t 'png') | |
| outputfile="$outputdir/$filename" | |
| pngnq -f -e '.png' -d $tempdir $outputfile && | |
| pngcrush -q -rem cHRM -rem gAMA -rem iCCP -rem sRGB $tempfile1 $tempfile2 && | |
| mv $tempfile2 $outputfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment