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

Image placeholders #100

Open
sifferhans opened this issue Apr 28, 2023 · 9 comments
Open

Image placeholders #100

sifferhans opened this issue Apr 28, 2023 · 9 comments
Labels
discussion Discuss a specific topic or a question nice to have Has a low priority. Feel free to pick it up and solve it when it bugs you.

Comments

@sifferhans
Copy link
Collaborator

sifferhans commented Apr 28, 2023

Not really an issue, but more of a question / idea.

At my work we handle quite a lot of images, and have therefore looked at a few solutions to improve perceived loading speed for them. I don't know if there are any image optimization solutions in the BMM api, but I see the images load quite slow at first page load (in the web app at least).

I've looked at Blurhash for good looking image placeholders, which has quite good support, and I've looked at Thumbhash which is more unknown. Another idea is to simply use a tiny version of each image until the full image loads. plaiceholder also looks nice

Is something like this implemented in the BMM api? If not, would it be an idea?:)

@sifferhans sifferhans added the discussion Discuss a specific topic or a question label Apr 28, 2023
@SimonSimCity
Copy link
Collaborator

Wow! Just more stuff: For Blurhash there exists a .NET implementation (for the API and for Xamarin) https://github.com/MarkusPalcer/blurhash.net which I couldn't find for Thumbhash. They even have a minimal code example: https://stu.dev/blurhash-on-xamarin/

And for Vue, there seems to be an easy2use lib: https://github.com/damienroche/vue-blurhash

@sifferhans
Copy link
Collaborator Author

sifferhans commented Apr 28, 2023

@SimonSimCity Yeah, it's really cool! They explain a bit about how and why they made it in this blog post.
The catch here is that Blurhash needs a <canvas> element to render the placeholder (at least by default)

The vue library you mentioned is Vue 2 only 😆 unpic might be an alternative, or @nuxt/image when that is ready

@SimonSimCity
Copy link
Collaborator

SimonSimCity commented May 2, 2023

https://github.com/nuxt/image doesn't seem to make much sense to me if not using SSR.

The catch here is that Blurhash needs a element to render the placeholder (at least by default)

I don't see this as an issue, because we'd anyways create our own element for this use-case, IMO.

The vue library you mentioned is Vue 2 only

I'm not afraid to fork it and port it over to vue3. Looking at the code it should be quite little of an effort.

@sifferhans
Copy link
Collaborator Author

This also looks promising 😊 It is used in the Elk web app, made with Nuxt
https://unlazy.byjohann.dev/integrations/nuxt.html

@sifferhans
Copy link
Collaborator Author

CleanShot.2023-05-10.at.16.09.55.mp4

This is how images currently behave before they are fully loaded. Would be pretty nice with some colorful blurry placeholders here 😁

@u12206050
Copy link
Member

Do we have the primary color of those images?
On activechristianity.org we have a datauri generated from the original image (scaled down->blurred) that we use while waiting for the image to load

@SimonSimCity
Copy link
Collaborator

@u12206050 that's what this is all about 🤗 just a bit more than just singular colors...

@SimonSimCity SimonSimCity added the nice to have Has a low priority. Feel free to pick it up and solve it when it bugs you. label Jan 4, 2024
@kkuepper
Copy link
Member

kkuepper commented Jul 4, 2024

@sifferhans @SimonSimCity Is this issue still relevant? For me the image experience is way better than one year ago:

  • we no longer show the ugly image placeholder
  • load speed feels quite fast

Shall we close this issue?

@sifferhans
Copy link
Collaborator Author

@kkuepper It is way better now, no question! 🤩

The perceived speed would probably be slightly better though if we had some sort of low-quality placeholder, average color, Blurhash etc. but it probably isn't worth it if it is a lot of work

If it was implemented in the backend it would also be usable on mobile. The placeholders on mobile is now a gray square

But it is probably ok to close the issue if it isn't worth it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discuss a specific topic or a question nice to have Has a low priority. Feel free to pick it up and solve it when it bugs you.
Projects
None yet
Development

No branches or pull requests

4 participants