Replies: 6 comments 2 replies
-
@styfle suggested that we could do some further assessment with this: |
Beta Was this translation helpful? Give feedback.
-
I'm running into similar limitations with a couple of PNGs featuring circular gradients. The artifacts are pronounced even when I'd love to have a prop when using |
Beta Was this translation helpful? Give feedback.
-
I created #32106 since I forgot about this RFC 😅 Another alternative proposal is to use |
Beta Was this translation helpful? Give feedback.
-
@styfle, I believe that's not working as expected. If I use 1. Original PNG image (PNG): 795 KB2. Optimized WebP
|
Beta Was this translation helpful? Give feedback.
-
Any news on providing lossless quality? or at least improving banding? |
Beta Was this translation helpful? Give feedback.
-
Looking forward for this too. |
Beta Was this translation helpful? Give feedback.
-
By default, images are compressed with lossy-compression.
When working with WebP, we know that
Goals
Allow for opt-in
lossless
image compression.Allow for dynamic image sizes.
Background
next/image
is designed to provide great out-of-the-box defaults for images. For most cases, this works well.For vector-like images (i.e. application screenshots, logos), the defaults can soften images, and even introduce small artefacts into those images. The defaults can also create larger images than we'd get by manually encoding an image with WebP Lossless.
The softness is mainly the result of scaling. In the below example, the images are
1320px
wide, displayed at660px
width. This should be a clean 50% reduction, but instead the image is first scaled server-side to750px
wide (57%), then scaled in the browser to660px
wide (88%). This is most apparent on 1x displays (you can change that in DevTools to try to simulate the effect).I've created this page as a simple demonstration of this (repo).
https://next-image-example.vercel.app/
Proposal
lossless
, for situations where a user knows that lossless may result in a smaller file-size.Alternatives
deviceSizes
orimageSizes
.Beta Was this translation helpful? Give feedback.
All reactions