-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
Description
I am looking at using Blurhash to get very small but nice blurred image previews : https://blurha.sh
The algorithm is quite simple and defined here: https://github.com/woltapp/blurhash/blob/master/Algorithm.md
There is a Ruby native Blurhash implementation, and it works fine using something like this:
image = Vips::Image.new_from_file(path)
Blurhash.encode(image.width, image.height, image.to_a.flatten)
Unfortunately this involves creating a huge array with all pixels and this is quite slow.
Do you think there is a way to have a more efficient implementation using Vips directly? I would be happy to have pointers, I am not really familiar with the low-level VIPS functions and if they can be used for this to avoid doing the computation using Ruby.
Thanks :)