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
https://pngmini.com
234 stars 32 forks source link

Update version to match ImageAlpha #12

Open joeyhoer opened 6 years ago

joeyhoer commented 6 years ago

The version of posterizer provided in ImageAlpha is different from posterize as it exists in this repo. This becomes evident when running the following:

$ posterize -v 64 test.png test.png
MSE=20.288 (Q=43, 64 levels)
$ wc -c test.png
210715 test.png
$ /Applications/ImageAlpha.app/Contents/MacOS/posterizer -v 64 test.png test.png 
MSE=17.192 (Q=50, 64 levels)
$ wc -c test.png
137719 test.png
kornelski commented 6 years ago

It's the same source, but difference is from build config. You'll get the same result when you build it from ImageAlpha's Xcode project. It's probably difference between using Cocoa vs libpng for reading.

joeyhoer commented 6 years ago

Trying to build from ImageAlpha fails with an error:

Undefined symbols for architecture x86_64:
  "_optimizeForAverageFilter", referenced from:
      _main in posterize.o

Trying to build from the command line using USE_COCOA=1 make fails because pam.h isn't linked. After including the files from libimagequant, I get a second error: error: unknown type name 'LIQ_PRIVATE'.

Any thoughts on what's missing?

kornelski commented 6 years ago

I've added the missing file and set up posterizer as a submodule (git clone --recursive; or git submoodule init)

kornelski commented 6 years ago

It also requires ImageOptim to be checked out in sibling directory to ImageAlpha :)

sergeevabc commented 5 years ago

Front-page mentions switch -b, but Posterizer 1.6 says invalid option, why?