the Sharp-YUV conversion technique, illustrated

This page showcases some RGB->YUV420 conversion techniques usable before JPEG/WebP/AVIF compression.
The 'fast' one is the simplest and less CPU-intensive. But it falls short on some classes of images shown below (thumbnails, screen-capture, ads...).
To remediate this, we present the 'Sharp-YUV' technique used in WebP, along with a new one ("new").
They better capture edges and vivid colors, while staying in YUV420 downsampled format. We utilise the upsampling used at decoding time (dubbed "fancy upsampling" in libjpeg e.g.) to our advantage.
Sharp-YUV locally optimizes the conversion loss, so is more expensive. That's why -sharp_yuv is not the default option in cwebp!
Quick keys: 1/2/3 to change algo. Use SPACE to view the original.



Y/U/Vconverted RGBerror map

Drag and drop image on the canvas above. Or .
Mouse-click will move the zoom area.
Mouse-Wheel will change the zoom level
Canvas key:
  • 1/2/3 display RGB for fast / reference /new sharp-YUV algo
  • f to toggle fancy upscaler
  • g to toggle gamma correction
  • space to show the source in reconstructed RGB