-
Notifications
You must be signed in to change notification settings - Fork 91
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
feature request: lqip #27
Comments
Thank you for the feature request @eleith, I really like this idea. For me, this is also a part of image/performance optimization and I think it will fit well into this package (as we already generate webp on the fly for example). I'm planning to rewrite this package (as it grew larger than expected and to be able to handle exactly the resource queries better) and release version 2 within the next few weeks. The plan is that all optimizations will be optional and when someone wants to use a specific optimization (like webp or lqip), he then just can install the required npm dependency and use the resource query provided by this package. Long story short, I'll add this optimization in version 2 :) I hope generating them for yourself still works in the meantime, I'll definitely keep you posted on this topic. |
thank you for the revealing response =] this has been a great library to work with. both in terms of using it to solve a very focused problem with web development in nextjs but also as a pattern for solving similar problems (i used your pattern to deal with serving fonts locally by using the file loader to both rename and copy them to an internal _next folder) anyhow, the roadmap looks great. i will be both happy to use it and customize it for some problems i am particularly interested in (resizing of images, auto LQIP production, etc etc) |
Hey @eleith But I now implemented LQIP into v2.1.0 as an optional package. There are now two additional resource queries: I would be happy if you can test it sometime and give feedback if it works as you expected it :) Example implementation: export default () => (
<div>
<img src={require('./images/lqip-test.jpg?lqip')} />
<Palette colors={require('./images/lqip-test.jpg?lqip-colors')} />
</div>
); |
trying it out right now and am happy with the results. upgrading to v2 was fairly straight forward and i'll be slowly replacing my custom lqip with these. i like how the lqip image is inlined when the image is small. i likely will need to use the css blur effect to make it look less blocky, but that is a concern of how the browser stretches out tiny images. thanks again for taking on the rewrite and improving this library even more. |
using something like lqip, i think it would be useful to import and image and request a low quality image placeholder to be generated (or to just extract the dominant color instead).
you likely could use these loaders independently, but i like the decision of this library to use url query params to drive signaling of intent on how to handle the image and i could imagine a
?lqip
or?lqip-dominant-color
as extensions of this module.for now, i'm just generating these myself, but in the spirit of DRY, this might be a useful direction to consider. i'ld be interested if you felt the same way or had previously considered and rejected the idea.
The text was updated successfully, but these errors were encountered: