Skip to content

Add method for lossless optimization of Huffman tables - #119

Merged
lilohuang merged 3 commits into
masterfrom
2.4.0
Jun 24, 2026
Merged

lilohuang merged 3 commits into
masterfrom
2.4.0

Conversation

@lilohuang

Copy link
Copy Markdown
Owner

This pull request introduces a new lossless JPEG optimization feature to the library, allowing users to optimize Huffman tables in JPEG images for smaller file sizes without changing pixel data. The update includes the new optimize method, corresponding tests, documentation updates, and a version bump to 2.4.0.

New Feature: Lossless Huffman Table Optimization

  • Added the optimize method to the TurboJPEG class, enabling lossless optimization of JPEG Huffman tables (similar to jpegtran -optimize). This reduces file size while preserving image data, with an option to exclude EXIF data. [1] [2]

Documentation and Example Updates

  • Updated README.md with a usage example for the new optimize method.
  • Expanded TESTING.md to document the new optimize test and its coverage in the test suite. [1] [2]

Testing

  • Added a new TestOptimize class in tests/test_turbojpeg.py to verify that the optimization is lossless and produces valid JPEGs with unchanged pixels.

Versioning

  • Bumped the version to 2.4.0 in both setup.py and turbojpeg.py to reflect the new feature addition. [1] [2]

@lilohuang
lilohuang merged commit 28ad3c2 into master Jun 24, 2026
21 checks passed
@lilohuang
lilohuang deleted the 2.4.0 branch June 24, 2026 15:15
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 this pull request may close these issues.

2 participants