psych0der / pngquantjs

Compress png images right in your browser
https://psych0der.github.io/pngquantjs/
98 stars 22 forks source link

Color difference between pngquant 2.8 and pngquantjs demo #8

Open yuyuyzl opened 2 years ago

yuyuyzl commented 2 years ago

It seems the output of pngquantjs has a slight diffence in color compared to the original image(or the output from the binary version).

Tested with a solid color png.

comppure Original

comppure-fs8 Compressed with pngquant 2.8 on macos

comppure-js Compressed with pngquantjs

FF99D5 -> #FF9FD3

yuyuyzl commented 2 years ago

As for gradient demo, the pngquantjs version looks a bit pale.

comp3 original

comp3-fs8 pngquant 2.8

comp3-js pngquantjs

yuyuyzl commented 2 years ago

well, i removed the default args and give the pngquantjs a fresh run, seems it is "Compiled with no support for color profiles."

so this would be the main problem

yuyuyzl commented 2 years ago

ok it is solved. To avoid the color profile difference, we could use a separate decoder to decode the png file, and encode it as a non-color-profile png, then feed it into pngquantjs. The decoder and encoder could be canvas