Skip to content

Conversation

@LucasChollet
Copy link
Member

@LucasChollet LucasChollet commented Oct 26, 2025

Here are some before/after on the images:

Image Buggie @ q75 Buggie @ q90 Buggie @ q100 Big image @ q75 Big image @ q90 Big image @ q100
Before 3240 5111 13.6kB 1 630kB 2 675kB 8 516kB
After 2924 4729 11.8kB 1 542kB 2 594kB 8 161kB
Difference -316, -10% - 383, -7.5% - 1.8kB, -13% -87kB, -5% -80kB, -3% -354kB, -4%

I expected performance to be worse as we're doing more work, but it turns out that this reduces the runtime for big_image.jpg @ q100 by 12%.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Oct 26, 2025
This will allow us to insert a pass to compute the most optimal Huffman
tables for this image.
Doing this a bit out of the natural order will allow us to compute
optimized huffman tables.

Note that we need to set the quantizations tables before calling
`fdct_and_quantization()`. So let's move this step to an explicit method
call in `add_image()`.
Compared to master, this gives approximatively 10% size reduction on
buggie.png and a 4% reduction on `big_image.jpg`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 pr-needs-review PR needs review from a maintainer or community member

1 participant