Video Code Convertor – RGB to YUV Pixel Conversation

Video Code Convertor – RGB to YUV Pixel Conversation

Let me first give introduction about RGB and YUV.
RGB and YUV are two different way of storing video.

RGB (Red, Green and Blue)
The RGB color model is an additive model in which red, green and blue
are combined in various ways to reproduce other colors.The name of the
model and the abbreviation “RGB” come from the three primary colors,
Red, Green and Blue.

YUV (Brightness and color)
The color encoding system used for analog television worldwide
(NTSC, PAL and SECAM). The YUV color space (color model) differs
from RGB, which is what the camera captures and what humans view.

YUV also saves transmission bandwidth compared to RGB. For rendering on
screen, all these color spaces must be converted back again to RGB
by the TV or display system

The YUV model defines a color space in terms of one luminance and
two chrominance components.YUV is used in the analog variant of the
PAL system of television broadcasting, which is the standard in
much of the world.Y stands for the luminance component (the brightness)
 and U and V are the chrominance (color) components

The Mathmatically conversion formula:

RGB to YUV Conversion
Y  = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16

V =  (0.439 * R) – (0.368 * G) – (0.071 * B) + 128

U = -(0.148 * R) – (0.291 * G) + (0.439 * B) + 128
YUV to RGB Conversion
B = 1.164(Y – 16)                  + 2.018(U – 128)

G = 1.164(Y – 16) – 0.813(V – 128) – 0.391(U – 128)

R = 1.164(Y – 16) + 1.596(V – 128)

2 Responses to “Video Code Convertor – RGB to YUV Pixel Conversation”

  1. Rachana Says:

    hi sanjay, thanks for appriciation of my writing..

  2. Loren Says:

    YUV does not save bandwidth. What saves bandwidth is YUYV (or UYVY) where 4 values represent 2 pixels (instead of 3 values per pixel.) So how do you convert RGB to YUYV?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: