Skip to content

yumeyao/pngoptim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNGOptim

PNGOptim is a CMD Batch file (Why?) for optimizing PNG files, aiming at good quality(small file size) with less effort(less tries hence runs faster).

It's inspired by similar projects such as ImageOptim, Trimage, etc.. However, PNGOptim doesn't follow all other projects' brute way, instead it only uses PNGOut and Zopflipng (Why?) in a smart way.

PNGOptim runs generally faster and the output is generally smaller because it's SMART not BRUTE.

FEATURE

  • Multi-CPU ready
  • Smart approach(not brute)
  • Multi-Files at one time
  • Safe for multiple instances

Usage

  1. Download the batch file (you can right-click and choose save).
  2. Ensure you have a copy of PNGOut, Zopflipng and DeflOpt and they are accessable(you can just put the exe files to the same directory as the batch file)
    As a respect of the authors, I DON'T contain the exe files in this project
  3. Now use it to optimize PNG files. They are optimized in-place.
  • Drag'n'Drop PNGs to the batch file or d'n'd folders.
  • Use the syntax "pngoptim pngfile1 pngfile2 pngfile3 pngfile4 ...".
  • Just run the command to see more syntax.

Limit

  1. On XP Home/2000, wmic is not present, assuming 2 logical CPUs.
    • Search for "InitParallel 2" and replace 2 in case you want to change the numbers on such OSes.
  2. Unicode paths that is not valid in current code page fails.
  3. As the sychronization is file-based. There is an astronomically small chance the synchronation goes broken if you run multiple instances at the same time.
    However it's not recommended to run multiple instances and it's not needed, you doesn't benefit from doing so.

TODO

  1. log in verbose mode.