kornelski / mediancut-posterizer

Lossy PNG compressor for RGBA PNGs. Has two modes: lossy averaging filter (blurizer) that denoises the image and optimal posterization using Median Cut quantization to reduce number of unique colors in the image with minimal visual distortion

Home Page:https://pngmini.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"posterize -b" produces larger files size at worse qualities

skaraman opened this issue · comments

I've tried a number of different options and no matter what I try, I can't get the command line of posterize -b to produce the same quality and file size as ImageAlpha.app.

Basically I'm taking ~300KB png and in ImageAlpha using Blurizer and about 64 quality is what I want and it gives me ~150KB png that looks great, but this process is manual.

Using the CLI I take the same png and provide these options "posterize -b 64" and the image looks really bad, broken, artifacts and the file size is ~300KB. I use "posterize -b -Q80" and the image looks good but the file size is 450KB+.

I tried lowest quality settings just to see and with 2 levels i get ~260KB image with total distortion of the image. At -Q10 I get a slightly artifacted image still relatively ok looking but ~400KB

Any help?

Raw/Source 319KB : test

Blurizer Quality 64 ImageAlpha 204KB : test blur

Posterizer.c -b 128 [in] [out] 600KB : test post

ImageAlpha shows a different scale in the UI (I couldn't be bothered to change scale of the slider for each tool :), so the numbers from the UI won't make any sense at all for the command line tool.

Ok I can understand that but even if I use like 220-250 levels to get around the quality I want, the resulting file size is much larger than the raw/source.

210 levels 638KB - test 210
235 levels 639KB - test 235
250 levels 650KB - test 250
255 levels 552 KB test 255

Your file doesn't have the right PNG filters applied. If I run it through lossless ImageOptim it decreases from 600KB down to 80KB.

I can't reproduce the problem with the binary I shipped with ImageAlpha.

Perhaps you have a buggy version of libpng?

thanks for your help it's definitely an issue in my libpng install