Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Dec 31, 2024

Resolves #539

Pillow will currently detect and use MozJPEG if it is installed. However,

  1. Pillow will report

--- JPEG support ok, compiled for libjpeg-turbo 4.1.1

4.1.1 is not a libjpeg-turbo version. It is the MozJPEG version. So this PR detects MozJPEG, and updates the report to say 'compiled for mozjpeg 4.1.1'

I've also added features.check_feature("mozjpeg")

  1. Testing in Ubuntu on GitHub Actions, there are currently 12 test failures.

Our current default behaviour is to not save progressive JPEGs, as documented in the saving keyword arguments at https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg-saving

progressive
If present and true, indicates that this image should be stored as a progressive JPEG file.

However, mozjpeg does save progressive JPEGs by default, unlike libjpeg-turbo. If I change the 'compression profile' from 'best compression ratio (progressive, all mozjpeg extensions)' to 'libjpeg[-turbo] defaults (baseline, no mozjpeg extensions)', then after I relax some image comparison checks, our test suite passes.

@radarhere radarhere added the JPEG label Dec 31, 2024
@hugovk hugovk merged commit 6bce9aa into python-pillow:main Jan 8, 2025
50 of 51 checks passed
@radarhere radarhere deleted the mozjpeg branch January 8, 2025 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatibility with mozjpeg

2 participants