lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
29.23k stars 1.29k forks source link

chromaSubsampling removed from webp in sharp 0.33.5? #4219

Closed Tor-sudo closed 1 month ago

Tor-sudo commented 1 month ago

Should we now use smartSubsample instead of chromaSubsampling for webp images? Is smartSubsample:false similar to chromaSubsampling: '4:2:0'?

lovell commented 1 month ago

WebP images are always 4:2:0 subsampled and there has never been a chromaSubsampling option.

The smartSubsample option tells the encoder to spend a bit more CPU time on the RGB to YUV conversion, which can improve colours around edges.

https://sharp.pixelplumbing.com/api-output#webp

Tor-sudo commented 1 month ago

WebP images are always 4:2:0 subsampled and there has never been a chromaSubsampling option.

The smartSubsample option tells the encoder to spend a bit more CPU time on the RGB to YUV conversion, which can improve colours around edges.

https://sharp.pixelplumbing.com/api-output#webp

Ok. But can i use it for avif?

lovell commented 1 month ago

https://sharp.pixelplumbing.com/api-output#avif

Param Type Default Description
[options.chromaSubsampling] string "'4:4:4'" set to '4:2:0' to use chroma subsampling