Skip to content

Conversation

@WildRackoon
Copy link

@WildRackoon WildRackoon commented Dec 12, 2025

Somes changes related to the dithering conversion code:

  • Fix RGB cache error values at the end of a row, not set to the right values (Blue values was used for R,G and B ?)
    I believe this is a mistake, this affects only the last column of the image, so it is likely very minimal, but I still really would like a second opinion on that.

  • Improved error diffusion readability, now the Floyd–Steinberg weights are readable through the code.

  • We should add more comments for posterity IMO, most of this dates back to the original PIL fork, the implementation is nicely optimized, but that makes the code slightly more confusing.

I mean look at this 😅:

/* propagate errors (don't ask ;-) */

Future improvement includes adding more dithering kernels in the same optimized manner.

If anyone needs more details on those changes, I published a gist for that here: https://gist.github.com/WildRackoon/0030fc3d4db3f4af73e2cdac19bbdf6d

@radarhere
Copy link
Member

but I still have to make some more tests with regards to that.

Are you saying this PR is not yet ready for review?

@radarhere radarhere changed the title Dithering Fix and readability Fix dithering and improve readability Dec 12, 2025
@WildRackoon
Copy link
Author

but I still have to make some more tests with regards to that.

Are you saying this PR is not yet ready for review?

I edited my comment, It builds fine and works as intented: the result is the same as before with a bunch of test images I tried.

But I it is not like we can test that with a ground truth and improve the test suite to that end, so someone's second opinion would be nice.

@radarhere
Copy link
Member

You can see that our test suite is failing with your changes. I've created WildRackoon#1 to update our expected results.

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