by CookWithMe · 11y ago · 0 comments
I'm currently working on a project that needs alpha channels. I've been optimizing the images with pngcrush, which helped (interestingly, images put out with Adobe products where already pretty optimized, but I'm generating thumbnails locally with sips, where pngcrush often saves 60+%).
Still, for photographic images, file size often remains multiple times larger than what I'd expect from a high-quality JPEG.
I do. Lossy PNGs work great for images with not a lot of colors. I use pngquant and optipng a lot in my work to compress a lot of PNG images with practically no visual quality loss.
For very colorful images, lossy (quantized & dithered) PNGs just don't work, though. They just end up looking nasty with larger filesizes than what high quality JPG gives you.
@echo off
set batchdir=%~d0%~p0
:start
"%batchdir%pngquant.exe" --ext .q.png --force --verbose 256 %1
"%batchdir%optipng.exe" -force -o4 -out "%~dpn1.opt.png" "%~dpn1.q.png"
del "%~dpn1.q.png"
shift
if NOT x%1==x goto start
rem pause