Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color difference between pngquant 2.8 and pngquantjs demo #8

Open
yuyuyzl opened this issue Oct 26, 2021 · 3 comments · May be fixed by #9
Open

Color difference between pngquant 2.8 and pngquantjs demo #8

yuyuyzl opened this issue Oct 26, 2021 · 3 comments · May be fixed by #9

Comments

@yuyuyzl
Copy link

yuyuyzl commented Oct 26, 2021

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
Copy link
Author

yuyuyzl commented Oct 26, 2021

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

comp3
original

comp3-fs8
pngquant 2.8

comp3-js
pngquantjs

@yuyuyzl
Copy link
Author

yuyuyzl commented Oct 27, 2021

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
Copy link
Author

yuyuyzl commented Oct 27, 2021

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

@yuyuyzl yuyuyzl linked a pull request Oct 28, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant