Bash loop logs per-step PNG size and timing when chaining pngquant and oxipng
A developer shared a bash script that runs pngquant and then oxipng on each PNG in a folder, recording byte sizes and timestamps for every step. Using Time::HiRes via perl keeps the timing format consistent across machines, and awk aggregates results by filename prefix. On 12 Wikimedia Commons PNGs, pngquant cut total size by 68.3% and oxipng removed a further 2.9 percentage points. The second step was the slower of the two, adding about five seconds in total across the set. The author notes that zopflipng gave little extra savings in a separate run, and that swapping the tool order produced slightly different results.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in