Skip to content

Bitmaptools bugfixes #5616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 24, 2021
Merged

Bitmaptools bugfixes #5616

merged 4 commits into from
Nov 24, 2021

Conversation

jepler
Copy link

@jepler jepler commented Nov 24, 2021

Previously, Floyd-Stenberg dither couldn't be accessed, because its constant had the wrong value.

When it was enabled, there were occasional artifacts in all-white areas. Switching from an under-parenthesized shift to a well-parenthesized division makes the artifacts go away.

There was also an off-by-one problem loading image data that caused row 2 to be duplicated. You could see this most clearly by repeatedly dithering an already-dithered image back into itself.

Closes: #5568

this happens to make the occasional FS dither artifact disappear.
I guess `a * b >> 8` and `(a * b) / 256` are not identical.  I'm not
sure if it was just the parens or not, but write the clearer code and
rely on the compiler to substitute an appropriate shift if possible.
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes!

@tannewt tannewt merged commit 153ff60 into adafruit:main Nov 24, 2021
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.

floyd-stenberg dither is a bit wonky
2 participants