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

Error: cannot read PNG from stdin

pngqu opened this issue · comments

Hola,
Running it on Windows:
posterize.exe -q 90 < before.png > after.png

I got: "Error: cannot read PNG from stdin".

Perhaps it's the LF<>CRLF conversion done in "text mode". Try setting binary mode, like pngquant does:

https://github.com/pornel/improved-pngquant/blob/master/pngquant.c#L860

Sorry but i do not understand (im not a programmer). I need some help please. I've tried:

  • posterize -q 90 -d 16 ^< before.png ^> after.png, that gives the program usage.

If i have to modify something in the posterize.c, i do not know what i've to change.
Thanks in avance.

Thanks. It works now. Is that a chance that posterize only work in the RGB channel (not the alpha) ? It's very efficient but it also damage the alpha too much. I've tried:

  • posterize -q 100 < before.png > after.png
    Here's the picture:

after

Can you share the compiled executable?

Posterization gives best compression when it's applied to all channels. If something looks bad, then increase number of posterization levels.

Latest version has better handling of gamma correction, which improves alpha at the same time