google / guetzli

Perceptual JPEG encoder
Apache License 2.0
12.89k stars 979 forks source link

Support output as YUV420? #79

Open abcfy2 opened 7 years ago

abcfy2 commented 7 years ago

Sometimes I need more compression ratio for web images. Seems that YUV420 is a good idea.

jyrkialakuijala commented 7 years ago

If you have a 1024x768 image and store it in YUV420, you will end up with a 1024x768 Y image, and 512x384 U and V images. A YUV444 alternative for more compression is to is to reduce resolution slightly in all planes. For example, resample 1024x768 to 768x512.

YUV444 gives less surprise with demanding images, particularly images with green-red boundaries, and is a denser compromise in the usual case for a given Butteraugli score.

abuisine commented 7 years ago

While providing either PNG (which are RGB converted to YUV444 in the code) or JPG in YUV444, It would be great to have a guetzli option to downsample the content to YUV420 prior to compression in order to have a resulting JPG YUV420 at the end of the process.