IIRC all video codecs (WebP and AVIF are simply intra frames from VP8 and AV1 respectively) work in the YUV color space because the color information is much lower frequency than brightness, and thus YUV is more easily compressible than RGB. Chroma subsampling (making each U and V correspond to a 2x2 block of Y) works for the same reason.