Skip to content
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

feat(Utils): blurhash #489

Merged
merged 9 commits into from
Sep 9, 2023
Merged

feat(Utils): blurhash #489

merged 9 commits into from
Sep 9, 2023

Conversation

GeopJr
Copy link
Owner

@GeopJr GeopJr commented Sep 4, 2023

fix: #487

This is a pure Vala blurhash decoding implementation inspired by https://github.com/woltapp/blurhash and https://github.com/mad-gooze/fast-blurhash/.

FAQ:

  • Q: Why not use the 'official' library?
  • A: It's unoptimized (for example, it calculates sizeFlag, numX, numY and size twice, once for the validation check and then for the decoding again). Additionally, by writing it in pure Vala it makes use of Glib (and lets Vala handle the memory).
  • Q: Why does it not match the 'official' library's results 1:1?
  • A: It uses parts of fast-blurhash's algorithm, which is (or at least should be) faster but has slightly different results.

TODO:

  • unit tests
  • actually use them
  • move the pixbuf -> paintable part into its own function?

@GeopJr GeopJr marked this pull request as ready for review September 9, 2023 00:09
@GeopJr GeopJr merged commit 0b9d7a5 into main Sep 9, 2023
4 checks passed
@GeopJr GeopJr deleted the feat/utils/blurhash branch September 9, 2023 00:14
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.

Use blurhash for images?
1 participant