johannschopplich/kirby-blurry-placeholder

Make placeholders smoother

CHE1RON opened this issue ยท 9 comments

Hey there,

when using your plugin "as-is", I get this:

Screenshot 2023-03-25 at 19 24 40

From the banner image, I was under the impression to get softer gradients and overall smoother images, is there a way to "improve" the output quality by tweaking parameters? Or is it my images (strong light/shadow transitions etc)

Thanks!

// Edit:

For PNG files with transparency, I get this:

Screenshot 2023-03-26 at 09 04 44

Hello there!

You can try to improve the pixel target to generate bigger thumbnails (although not recommended), which are embedded into the blurry SVG placeholder. The implementation mocks the one from Google's former AMP project. I'm not sure what you expected. In my opinion, your placeholders are smooth. Every image is different. So yeah, maybe it's the color contrast.

Regarding transparent images, there is the transparent option for both $file->placeholder() and $file->placeholderUri() field methods. It will omit the artifacts of transparent images.

There is also a different implementation for blurry images using the blurhash algorithm by @tobimori which you might prefer, since more details is preserved. You can check it out as well: kirby-blurhash

@tobimori Great input! ๐Ÿ‘

Thanks you guys! Seems even @johannschopplich learned something ๐Ÿ˜… (just kidding)

Absolutely! The younger generation builds upon what the older one has created and teaches a lesson or two. Circle of life. ๐Ÿ™ƒ

The Gaussian blur parameter could be a plugin option. ๐Ÿ‘€

Not sure about who's the younger generation here ๐Ÿคฃ

That's what I ended up with (note the blur in the beginning, the bw-color effect applies to all images, see the end of the clip, when scrolling up again)

lazy_480.mov

The filesize savings are quite decent, and in accordance with the bw effect, with placeholders being generated as bw, this shaves some additional kb ๐Ÿ˜‰

Absolutely! The younger generation builds upon what the older one has created and teaches a lesson or two. Circle of life. ๐Ÿ™ƒ

The Gaussian blur parameter could be a plugin option. ๐Ÿ‘€

TOTALLY!