You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should improve defaults and give more control to end-users when generating new image formats or sizes.
Background & Motivation
When resizing images through getImage (or any of the higher-level components, such as <Picture /> component), options inherent in the source image are lost, most notably the use of "lossless" compression from PNGs and TIFFs. Both WebP and AVIF support lossless modes, but the current implementations do not leverage them.
Changes to defaults should not be taken lightly; this can cause significant changes in quality and image sizes for end users. When a getImage call is made without resizing or changing format of the source image, I've already noticed that sometimes the output is a larger file size than the original (fyi, I am using "sharp") due to different defaults than the source image.
I would suggest passing options through to the image service, the same way the MDX plugin allows passing options to remark, etc.
Goals
Provide the developer additional options for compression of images
Use smart defaults to prefer lossless compression when the source image is saved using lossless compression
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Body
Summary
We should improve defaults and give more control to end-users when generating new image formats or sizes.
Background & Motivation
When resizing images through
getImage
(or any of the higher-level components, such as<Picture />
component), options inherent in the source image are lost, most notably the use of "lossless" compression from PNGs and TIFFs. Both WebP and AVIF support lossless modes, but the current implementations do not leverage them.Changes to defaults should not be taken lightly; this can cause significant changes in quality and image sizes for end users. When a
getImage
call is made without resizing or changing format of the source image, I've already noticed that sometimes the output is a larger file size than the original (fyi, I am using "sharp") due to different defaults than the source image.I would suggest passing options through to the image service, the same way the MDX plugin allows passing options to remark, etc.
Goals
Beta Was this translation helpful? Give feedback.
All reactions