Add a low-quality-placeholder directive
See original GitHub issueThis has been a requested feature and one that I’d argue is a wothwhile addition to the library. I’m not quite sure on the specific syntax though and would like to get some feedback!
My proposal would be:
- Keyword:
lqip
- Type: boolean
Where lqip invokes the following steps:
- resize to a width of 640px
- set quality to 50
The question is wether these values should be customizeable on if so how? An integer that scales the values accordingly? I don’t want this directive to do too much since stuff like blurring can and should be added by the user to their liking.
_Originally posted by @rchrdnsh in https://github.com/JonasKruckenberg/imagetools/discussions/69_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:6
Top Results From Across the Web
vanilla-lazyload | Yarn - Package Manager
To have a low quality placeholder, add the src attribute pointing to a very small version of the image. E.g. src="lazy_10.jpg" .
Read more >vanilla-lazyload - npm
To have a low quality placeholder, add the src attribute pointing to a very small version of the image to the img tag....
Read more >Lazy loading images with accessibility and printer support
No wasted image bytes. This solution calculates the actual size of the image to be requested. So instead of adding breakpoints in something...
Read more >Image Editable - Pimcore
Name Type Description
width integer Width of the image in pixel
height integer Height of the image in pixel
hidetext boolean Hides the input for the...
Read more >Add alternative text to a shape, picture, chart, SmartArt graphic ...
Create alternative text for pictures, charts, or SmartArt graphics so that it can be used by accessibility screen readers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I agree on blurring, that should be handled by the user to fit their desired aesthetic.
I do think both the size and quality should be customizable to an extent (I like the idea of using an integer that scales the values accordingly), but I don’t think there’s really a need for fine grained controls given lqip would be, ultimately, for the sake of convenience.
If a user needs the ability to highly customize the placeholder image, they should import the placeholder using the provided directives as that’s going to give the most granular control in terms of the resulting image.
E.g. I currently import placeholder images, which is passed into a lazy loading responsive image component (along w the srcset imported separately), by doing the following:
Edit: Great work on this library by the way; love using it in with SvelteKit.
Is this an official feature now? It looks like it was added as a directive by @JonasKruckenberg. Not mentioned in the Docs however.