Created
July 23, 2014 17:18
-
-
Save sixlettervariables/c9c8a880e0a2edc09e61 to your computer and use it in GitHub Desktop.
Batch compression of PNG's with OptiPNG for Windows (non-recursive, same directory)
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
:: | |
:: Non-recursive OptiPNG batch conversion. | |
:: Based on http://superuser.com/a/604502 | |
:: | |
:: Caveats: 1. Will reduce colorspace if possible (Color -> Grays) | |
:: 2. Will overwrite images in-place | |
:: | |
@echo off | |
echo. | |
set apppath="OptiPNG.exe" | |
if [%1]==[] echo Usage: %0 "PNG Dir" && echo. && echo Error: Invalid parameters && goto :EOF | |
if not exist %1 echo Usage: %0 "PNG Dir" && echo. && echo Error: Invalid directory "%~1" && goto :EOF | |
%apppath% "%~1\*.png" -zc9 -zm9 -zs3 -f0-5 -strip "all" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment