A study of colour - Part 1: RGB - The additive colours

Jpegs use the three primary colours RGB in the Additive Colour Model

It turns out there are a lot of ways to identify colour.  We learn early on how to identify colours - the primary Crayola crayon box carries green, yellow, orange, red, blue, purple, brown, and black. As we advance into larger colour palettes, we find there are several shades of each with a white thrown in.  Then, when it comes to painting, the world of colour opens up to us as we find we can mix paints to produce an almost infinite range of colours.

We have to draw a line between analogue colour (film) and digital colour (computer).  Film produces continuous colours, albeit with a limited spectrum compared to what modern digital cameras can capture.  Colour information from digital sensors is based on integers and is not continuous in nature.  To put that more succinctly, analogue deals with real numbers with every imaginable decimal between any two numbers, while digital has only whole numbers to rely on.  The colour models we will look at in this series relate to the digital system.

In the RGB (red, green, and blue) colour model, the three primary colours are used to create the rest of the colours in the palette.  The palette is the combined group (set) of colours possible in the model and can vary considerably.  We will look at palettes later in another blog.

Each of those colours is called a channel.  In jpegs, each channel can be represented by any integer from 0 to 255 - that's 256 levels.  As it turns out, 256 is the same number of possible combinations in a byte, being 2^8 (2 to the power of 8), or 8 bits that make up a byte.  This is not coincidental, as it takes 3 bytes to represent the colour of a single pixel.  The total number of possible colours is 256^3, which produces over 16 million different values.  So, 8 bit (also called 24 bit) colour produces over 16 million colours.

It turns out that 16 million is not enough to produce all the shades we see in nature and can sometimes lead to something called colour banding when subtle changes in shade occur.  To prevent this, sometimes 16 bit (or 48 bit) colour is used, where each channel is made of 2 bytes and produces over 65,000 different shades.  The total number of possible colours here then is 65536^3 or over 281 trillion colours.  This is also called true colour.

Jpegs can't be saved in true colour; other file types must be employed.  These include tiffs, pngs, and jpeg 2000s.  The problem with tiffs is that they are uncompressed and very large files.  A 24 megapixel 16 bit image take up 144 mb (megabytes) of memory.  Seven of them use 1 gig of memory!

Thanks for reading.

Eric Svendsen     www.ericspix.com

Comments

Popular posts from this blog

Harjit Bahia - Science teacher and colleague from Garibaldi died August 2, 2024

Munson pond - before and after road development

My longsuffering search for the Western Meadowlark