# What's the difference between fiding backgrounds w/ YUV and RGB?

Page 1 of 1

## 1 Replies - 2908 Views - Last Post: 19 September 2012 - 11:10 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=292515&amp;s=4cfb43a54cd9f92bc80b2d72d1189acc&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 JavaLilly

Reputation: 0
• Posts: 30
• Joined: 05-September 12

# What's the difference between fiding backgrounds w/ YUV and RGB?

Posted 19 September 2012 - 04:43 PM

I am supposed to find the background of a picture using RGB Color and using HSV or YUV Color space?

Could someone explain what the difference is? Aren't they all finding the background with color values?
I looked everything up and still do not understand.

Any help is appreciated.
Is This A Good Question/Topic? 0

## Replies To: What's the difference between fiding backgrounds w/ YUV and RGB?

### #2 grimpirate

• Pirate King

Reputation: 149
• Posts: 717
• Joined: 03-August 06

## Re: What's the difference between fiding backgrounds w/ YUV and RGB?

Posted 19 September 2012 - 11:10 PM

In terms of your eyes, there's no real difference. So your assumption about finding the background color values is correct in terms of the procedure. In other words, pick a pixel, and sample its color. However, the number/int/bitwise value of the pixel is interpreted differently based on the color space.

RGB uses an additive color model composed of three primary colors (red, green, blue) that range from 0 to 255 (inclusive).
HSV refers to hue, saturation, and value, and is only different from RGB in terms of the mathematics. Conceptually, it's the same thing, three values of some sort produce a 24 bit color.
In YUV it's a luma and two chrominance components which also define a 24 bit color. Again, the only difference is the math.

The maths are different because the way you define a color depends on its intended application. RGB makes sense for LCD screens because your pixels are composed of tiny crystals that only show red/green/blue at different intensities. There is a model which is not discussed here which is CMYK (cyan, magenta, yellow, black). That color model tends to be used in printing, because it represents the mix of colors necessary to get the color you're seeking in a printed format.

So, to conclude/summarize. The difference is interpretation and application. In terms of retrieving a value there is no difference, except that the values may have more meaning perceptually if you use one color space as opposed to another. The relevance varies with the application you are coding. If it's simply an exercise then it makes no difference other than demonstrating your understanding of retrieving a color value in different ways.

As an aside, if you tweak one of the three values of an original image in a particular color space, the output effect is also markedly different. So image processing can also come into play.

This post has been edited by grimpirate: 19 September 2012 - 11:14 PM