 <p>"YUV" is not a complete format.</p> <p>From <a href="http://en.wikipedia.org/wiki/YUV" rel="nofollow">this wikipedia article</a> you can get the conversions of YUV411,YUV422,YUV420p to YUV444. Combine the inverse of these transforms with your RGB conversion and you'll get the result.</p> <p>The thing you are missing: one RGB triple may produce a number (not one) of YUV components this way.</p> <ol> <li>YUV444 3 bytes per pixel</li> <li>YUV422 4 bytes per 2 pixels</li> <li>YUV411 6 bytes per 4 pixels</li> <li>YUV420p 6 bytes per 4 pixels, reordered</li> </ol> <p>First, YUV422</p> <p>Y'UV422 to RGB888 conversion</p> <p>Input: Read 4 bytes of Y'UV (u, y1, v, y2 )</p> <p>Output: Writes 6 bytes of RGB (R, G, B, R, G, B)</p> <p>Then YUV4111</p> <p>Y'UV411 to RGB888 conversion</p> <p>Input: Read 6 bytes of Y'UV</p> <p>Output: Writes 12 bytes of RGB</p> <pre><code>// Extract YUV components u = yuv[0]; y1 = yuv[1]; y2 = yuv[2]; v = yuv[3]; y3 = yuv[4]; y4 = yuv[5]; rgb1 = Y'UV444toRGB888(y1, u, v); rgb2 = Y'UV444toRGB888(y2, u, v); rgb3 = Y'UV444toRGB888(y3, u, v); rgb4 = Y'UV444toRGB888(y4, u, v); </code></pre> <p>Similar with 420p, but the YUV values are distributed over the rectangle there - see the Wikipedia's diagram and image for that.</p> <p>Basically, you should fetch 4 RGB pixels, convert each one of them to YUV (using your hopefully valid 444 converter) and then store the YUV[4] array in a tricky way shown at the wikipedia.</p>