-
Notifications
You must be signed in to change notification settings - Fork 72
Fix Blurhash approximation mode artifacts with lookup table #71
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
Fix Blurhash approximation mode artifacts with lookup table #71
Conversation
@mark8044 try it and let us know if this fixes the issue for you just use this branch for testing : flutter_blurhash:
git:
url: https://github.com/Rahiche/flutter_blurhash.git
ref: fix/srgb-approximation @bartekpacia I added a basic smoke test since you added the test folder to the requirements but there were none previously, I updated the workflow to not have --debug option for building because it doesn't exist on flutter 3.27 |
LGTM. Grid is a nice addition I would just use a different source so we can also check different gradient behaviors (color/contrast) by having precise color zone. Pixel peeping but that's how far we are. |
@Rahiche Hey this looks great and seems to be working wonderfully! Thanks much EDIT: I don't know if im using it wrong, but it doesn't even seem much darker on approximation. Double win :) |
@mark8044 Awesome, yeah the new method is much faster and more accurate, thanks for reporting the issue as I got to dig deeper into it. |
Hi @Solido I removed the demo app from this PR as I think it would be better to make a separate PR for the grid demo with more control and options. This PR seems to solve the main issue reported for now so if you can merge it and release a new version that would be great. |
Fixes #70
I made a simple demo app to visually compare all possible results for a single image. While researching the topic, I discovered that the lookup table method is even faster with only slightly more memory usage. The new implementation creates a single lookup table with all possible results instead of performing expensive operations each time.
The current approximation method using square roots was causing visible artifacts in the decoded images. By switching to a lookup table with interpolation, we get both improved quality and better performance.
Before (approximation model):
After (lookup table model):
The demo app is not required to be part of the PR but will be helpful for easy visual testing