Better average color extraction infra #37

Closed
opened 2024-10-27 15:52:01 +00:00 by Rubicon · 3 comments
Owner

We frequently use FastAverageColor and it's slow. We may need further managing to control its performance impact.

We frequently use `FastAverageColor` and it's slow. We may need further managing to control its performance impact.
Author
Owner

I am considering extracting the average colour from blurhash if we have the blurhash. That seems it’s easy enough to implement the average colour and even the css gradient - it even directly encodes the average color in the hash. I think it’s a good way to reduce the hunger of the performance by reducing the use of the FastAverageColor (which uses canvas).

Related links:

I am considering extracting the average colour from blurhash if we have the blurhash. That seems it’s easy enough to implement the average colour and even the css gradient - it even directly encodes the average color in the hash. I think it’s a good way to reduce the hunger of the performance by reducing the use of the FastAverageColor (which uses canvas). Related links: - https://github.com/woltapp/blurhash/blob/master/Algorithm.md
Author
Owner

As I considered, we can write the decoders in zig, and directly plug them in as the WASM. Our targets all support WASM.

As I considered, we can write the decoders in zig, and directly plug them in as the WASM. Our targets all support WASM.
Rubicon self-assigned this 2024-11-11 07:20:25 +00:00
Rubicon added this to the v1.1.0 milestone 2024-11-11 07:20:28 +00:00
Author
Owner

For toot attachments and previews, now we can use the average colour from the blurhash. The banner image of profiles does not provide blurhash alongside - we could not optimize this use case tho.

For toot attachments and previews, now we can use the average colour from the blurhash. The banner image of profiles does not provide blurhash alongside - we could not optimize this use case tho.
Sign in to join this conversation.
No description provided.