Replies: 4 comments
-
While it's still not the "using Vips directly", try resizing the image to 100x100 and see if it works enough well for you:
|
Beta Was this translation helpful? Give feedback.
-
I think the DCT would probably need to be implemented in C or C++. Let's tag this as an enhacement. |
Beta Was this translation helpful? Give feedback.
-
... an enhancement on libvips, I mean |
Beta Was this translation helpful? Give feedback.
-
@Nakilon Thanks for the suggestion, I am already doing a resize before calculating the blurhash to reduce the number of ruby allocations, but I think it can be even faster and memory-efficient :) @jcupitt Ok, I was not sure it could be done, if vips gets primitives to do this it would be awesome! |
Beta Was this translation helpful? Give feedback.
-
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:
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 :)
Beta Was this translation helpful? Give feedback.
All reactions