-
Notifications
You must be signed in to change notification settings - Fork 4
Add querying for blurhash string to be decoded on the client? #2
Comments
Perhaps exposing |
You're right, this transformer is serving already decoded blurhashed images to the client. The goal here is to serve a placeholder while the real image is loading and doing all the CPU-intensive work at build time will make it easier on the user's CPU to do other tasks. |
The way blurhash is advertised is to do decoding on the client. I believe if it’s not done that way it might be misleading to users of this plugin. From https://blurha.sh/
It is not that CPU intensive and takes under 16ms, but more like 1-4ms in my testing for previews of around 30x40 pixels. On mobile web browsers it also runs smooth including iPhone 5C (a phone from 2013). Blurhash wouldn’t really make sense as an idea if it was too heavy. People who use blurhash in a form of gatsby plugin might assume they get much smaller representation of the encoded image, whereas in fact they simply get base64 string. You could bypass blurhash entirely and get the processed jpeg from I think the addition concerns exposing
|
That sounds good, want to make a PR ? |
Hey @m5r I am getting this error when trying to push a branch to this remote: Before I update README I wanted you to see the code in [work-in-progress] PR. |
You have to fork the repo first Check out GitHub's guide on how to submit a contribution |
@m5r hey, I would like to get your OK on the code before I update README, thanks. Opened the PR ^^ |
From my understanding, serving image as base64 doesn’t realize full potential of blurhash. Full benefit of blurhash algorithm is that it produces a string significantly smaller than base64 of the thumbnail-sized JPEG.
This transformer sends base64 to client, if I followed the code correctly.
The text was updated successfully, but these errors were encountered: