Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know what fraction of jpegs in the real world are 4:2:0?

For photos I use whatever the camera likes, but for everything else I use 4:4:4.




It's good to remember that image sensor pixels only have one colour anyway (they are each either G, R or B). 67% of colour information is made up right from the start before your even encode anything. Another reason why 4:2:0 sampling may not be as bad as it sounds.


For cameras outputting at their max megapixel rating, yes.

If you're outputting at a lower resolution or not using a camera then it can be a notable loss of quality.

Most web images are probably scaled down, and in other contexts I bet it's similar. If you're looking at a raw camera shot you're usually only dealing with one at a time, so while simplicity is nice the RAM impact of those will be limited.


If you're looking to save on storage/bandwidth (hence not using the max resolution of your camera) it can absolutely be a good idea to spend more bits on Y than on C.


Yeah, High quality exports (definitely from Lightroom) are normally YCrCb444. You don't always need it, but often you do if you really care about fidelity.

I know several imaging apps have the ability to select which subsampling type to use as well.


Going by the terrible colour bleed I see regularly I'd say quite a few of them, somewhere along their lifetimes.

Seriously though chroma subsampling is not kind on any kind of red shape, it's especially bad against white backgrounds.


That's because JPEG decoders use poor upscaling algorithms. I think libjpeg uses nearest neighbor.

It's pretty easy to write a better one since the full resolution image is already available for the Y plane, you can do super resolution.


Well easy is relative, but yeah you can do quite a lot better than the basic bilinear or bicubic upsampling that seems to be common. However most common image tools (and video players) don't seem to put in the effort, with very few exceptions.


ImageMagick seems to encode JPEGs as YUV444 for quality > 90, and I saw at least one other JPEG encoder use the same quality threshold.


> Does anyone know what fraction of jpegs in the real world are 4:2:0?

Most of them. Pretty much the default subsampling for libjpeg(-turbo).


I sampled my jpegs randomly. My image downloads seem to be all 420, and the photos 422.


Any jpeg on social media is going to be chroma subsampled when the site recompresses it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: