Repository navigation
Conversation
Open
Contributor
Test coverageCompared with master where the branch left it (24a7a85).
Changed
|
matmen
marked this pull request as ready for review
November 28, 2026 22:37
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
encodeJPEG({ progressive: true }): browsers show the whole picture blurry first and sharpen it while the file loads, and the file is 2 to 4% smaller for photos. The pixels are the same as in the baseline file of the same quality.Refs #85. Trellis quantization and tuned quantization tables aren't part of this PR.
falseby default, so existing files stay byte for byte the same. The encoder translates libjpeg's progressive encoder (jcphuff.c) and uses mozjpeg's scan script (8 scans for color, 4 for grayscale), each scan with its own Huffman tables. Both are credited in the file header,THIRD_PARTY_NOTICES.mdand the README.On 14 photos the files are 2.1% (quality 60), 2.6% (80) and 3.2% (92) smaller. Encoding takes up to 1.3 times as long (a 2400×1600 photo at quality 80: 80 to 97 ms).
Checked:
cjpeg -scans(libjpeg-turbo 2.1.5) with the same script gives identical files for 288 cases.tests/jpeg-progressive-encode.jskeeps 16 of them as hashes, aimed at the corners of the coding.