Log in

View Full Version : how to make raw yuv -> jpg?


PerCIVaL
7th March 2003, 23:06
First of all, I'm not that familiar with colorspaces. I know that yuv colorspaces have one intensity and two color components but that's about it (so any enlightenment here would be very welcome too).

Is it possible to make a still out of captured yuv video without color conversions?

Is the same possible for yv12? This one is harder because I believe jpg's can't internally contain yv12 (any other format that can?)

and a bonus question: Can one convert yv12 to yuv and back losslessly?

fccHandler
8th March 2003, 02:59
JPEGs are very flexible and can easily contain YUV, YUY2, and YV12. However, JPEG compression is lossy, and I suspect that the compression itself will degrade the quality far more than the color space conversion would.

Anyway, the answer to your first question is yes it's possible, though I can't think of a program offhand that will do it. (Maybe PhotoShop?)

As for the bonus question, the conversion from YV12 to YUV involves upsampling the U and V planes by a factor of 2. AFAIK it can be done losslessly if you use a "nearest neighbor" method when upsampling, and use the same method to downsample back to YV12. But the conversion from YUV to YV12 will always be lossy in every other situation I can think of.