User:Zcrayfish/pngtool
From Wikipedia, the free encyclopedia
Contents |
[edit] Info
The script I use to optimize PNGs is below.
In my opinion, it is a little overly complicated, but it gets the job done.
The script is in the public domain.
[edit] Usage/Installation
What you need to do is have the programs below in your %windows%\system32 directory (or one of the other %path% directories) and then you have to put the script below in the same directory as your input file (input.png) and then you execute the script. The script should have the .CMD or .BAT extension, it is a plain text file.
[edit] Requirements
[edit] Notes
- Updated Jan 2007 - Adam7 now supported, images that do not have it should come back out with it
- Works best with 256 colour images
- Updated Jan 2007 - Does not work as efficiently as it should on 16 colour images. :-(
- Updated Jan 2007 - Now removes colour correction information... I hope it is NOT useful.
[edit] Windows Command Script Source
@echo off if not exist input.png goto ERR1 pngcrush -rem gAMA -rem cHRM -rem iCCP -rem sRGB input.png output.png del -f input.png ren output.png input.png optipng -i1 -o7 -fix input.png pngcrush -brute -reduce input.png output.png del -f input.png ren output.png input.png optipng -i1 -o7 -fix input.png pngcrush -brute -reduce input.png output.png echo "Reduced filesize by using a [[optipng]] > [[pngcrush]] chain." pause exit :ERR1 echo No input file or other error. (scroll up) pause exit