Working with images is clearly a complicated job. There are many edge cases to deal with and it get complex over times with all additional formats.
Also, there are a lot of things that can be done (optimisation, display resizing, a11y, etc.
My own "in house" solution were:
They did grow complicated over time and covered the following features:
next/link vs a)Some specialised libraries have been created
I'd like to know if Next.js intends to build something dedicated to Next.js, such as gatbsy has some gatsby-image
A Next.js official built-in or lib for handling images
The above mentioned libs.
I have been working on something to solve this for myself that might be of interest: https://github.com/humaans/next-img/. I agree, this is a fairly complicated area when developing sites with Next.js, I hope next-img can be of use to others or provide feedback to a potential native Next.js implementation.
Thanks @KidkArolis for this. I believe you should add some doc about how your lib is different from the 2 above mentioned, because it's not so obvious what are pros/cons in comparison. 馃槈
Also, in my personal case, I'm loading images from a CMS which doesn't optimise them. I can't load them from the filesystem like most optimisers (like yours) do. It's not processed at runtime either but at build time, because I generate static pages. So, I believe it'd be possible to optimise those images during the build somehow. (but, it's probably complicated to achieve)
FYI I read through this article today, and one of the most highlighted feature Gatsby provides and Next.js doesn't is an image lib.
https://medium.com/frontend-digest/which-to-choose-in-2020-nextjs-vs-gatsby-1aa7ca279d8a
Hi, an RFC has recently been posted for this by the Chrome team so I'm going to close this in favor of that
Most helpful comment
I have been working on something to solve this for myself that might be of interest: https://github.com/humaans/next-img/. I agree, this is a fairly complicated area when developing sites with Next.js, I hope
next-imgcan be of use to others or provide feedback to a potential native Next.js implementation.