-
Notifications
You must be signed in to change notification settings - Fork 33
Colour Models
A colour model is a mathematical system used to create a full range of colours from a set of primary colours. The range of colours available within a colour model is called a Colour Space - we'll discuss this further in another topic.
There are a number of different models used in varying industries, each with their own benefits and drawbacks. In this topic we will discuss the colour models available in MMAL.
The RGB colour model is commonly found in the computer graphics industry and is the colour model used by your computer monitor. It uses Red, Green and Blue as its primary colours, with white being created when all three primary colours are mixed equally at full intensity. When two of the primary colours are added together, we create a secondary colour, for example: Red and Green make Yellow, Blue and Red make Magenta and Blue and Green make Cyan - these secondary colours form the CMYK model.
The colours which make up the RGB Colour Space are defined by mixing the primary colours in varying amounts.
Source: Wikipedia
This colour model closely relates to the way the human eye perceives colour, and is very popular thanks to the the length of time it has been available and its simplicity. The downside to RGB is that it is not as efficient as other colour models when dealing with real-world images. To generate any colour within the RGB colour cube, all three RGB components need to be of equal pixel depth and display resolution. Also, any modification of the image requires modification of all three planes. [^1]
YUV is another colour model which takes human perception into account. This colour model has three components: Y (luminance), U and V (chrominance). The luminance component of this model represents the brightness, with UV representing colour.
Historically, YUV was found in analog televisions when engineers needed to find a way to provide colour to black & white infrastructure. The luma (Y') component was already in the black and white signal, so the UV components were added separately; this allowed existing B&W televisions to still function even with the UV components added. Today, YUV is still used in the computer graphics industry. [^2]
The advantage of using Y'UV is that the luma component is decoupled from the chrominance components, allowing the luminance to be changed without affecting the colour. This decoupling provides efficiency increases when transferring and manipulating YUV image data compared to RGB.
Below is an image showing how each component in the YUV colour model work together to form the original image:
Source: Wikipedia
[^1]: RGB disadvantages: Intel Developer Zone
[^2]: YUV history: Wikipedia