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

Linux and MacOS have different results #415

Open
hailuo966 opened this issue Jan 3, 2024 · 1 comment
Open

Linux and MacOS have different results #415

hailuo966 opened this issue Jan 3, 2024 · 1 comment

Comments

@hailuo966
Copy link

I used pngquant on Linux and MacOS,I compressed the same pngs,but the result are different.
Linux will compressed more png than MacOS,do you konw this issue?

@kornelski
Copy link
Owner

Differences between platforms are expected for multiple reasons. Optimization is not deterministic.

  • macOS version uses Apple's image decoder with Apple's color profile processing. Other versions use LCMS2. These result in slightly different interpretations of color profiles due to different implementations.

  • the library uses floating-point numbers. These may give slightly different results depending on compiler optimizations and math libraries in the OS.

  • the library uses multi-threading. This is a source of randomness in the program. Different machines may use a different number of threads, and threads will run at different speeds, which randomizes order of operations.

  • the library may use zlib provided by the operating system, and different versions of zlib may compress better or worse. For example on Debian Linux, you probably get a very old version of zlib.

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

No branches or pull requests

2 participants