L
LLLOS.ai
Learn
L

Ask Your Tutor · Computer Science

How do colours work in digital images?

General knowledge In depth Asked by Anonymous 22 Oct 2026, 11:23 PM IST Updated

In one line

Colours in digital images are made by mixing different amounts of red, green, and blue light for each tiny dot (pixel).

Pixel — Smallest addressable element of a raster image
Pixel — Smallest addressable element of a raster image
A close-up of a digital screen showing red, green, and blue subpixels that make up each pixel.
Image: Wikipedia

The rule

Each pixel in a digital image stores values for red, green, and blue (RGB), and these combine to make any colour you see on the screen.

The formula for a pixel's colour is: Colour = (R, G, B) where R = red value, G = green value, B = blue value (each from 0 to 255).

The formula
Colour = (R, G, B)
Rred value (0–255)
Ggreen value (0–255)
Bblue value (0–255)

Let's understand it simply

Imagine you are making rangoli during Diwali. You have three powders: red, green, and blue. By mixing different amounts of each, you can create many colours. Digital images do the same, but with light. Each tiny dot on your screen (called a pixel) is like a mini rangoli spot. It glows with some red, some green, and some blue light. When you change how much of each colour is in a pixel, you get different colours — just like mixing more red powder makes your rangoli look more reddish.

How it works

  1. Every digital image is made of a grid of pixels (tiny squares).
  2. Each pixel has three numbers: one for red, one for green, one for blue.
  3. The numbers can go from 0 (none) to 255 (full brightness).
  4. The screen mixes these three lights for each pixel to make one colour.
  5. Your eyes see the mix as a single colour, not separate red, green, and blue.
  6. By changing the numbers, you can make millions of colours (256 × 256 × 256 = 16,777,216).
How a pixel's colour is made
  1. Start with a pixel on the screen.
  2. Set its red, green, and blue values (0–255 each).
  3. The screen lights up each colour as needed.
  4. Your eye sees the combined colour.

The story behind it

The idea of mixing red, green, and blue light comes from how our eyes work. In the 1800s, scientists like Thomas Young and Hermann von Helmholtz found that our eyes have three types of cells (cones), each sensitive to red, green, or blue. Later, computers used this idea to show colours using the RGB model. The first colour TVs and computer screens used this method, and it is still used in your phone and laptop today.

Where you see it in real life

  • Mobile phone photos: Each photo is made of millions of pixels, each with its own RGB values.
  • TV screens: Every moving image is a grid of RGB pixels changing colours quickly.
  • Computer monitors: When you draw in Paint, the colours you pick are made by mixing RGB values.
  • LED displays at railway stations: Each letter or picture is made by lighting up red, green, and blue LEDs in different amounts.
  • Digital billboards: Huge screens use the same RGB trick to show colourful ads.
  • Printers (with a twist): Printers use a similar idea but with cyan, magenta, yellow, and black (CMYK), not RGB, because they mix inks, not light.

Why it matters

  • Image editing: Knowing how colours work helps you edit photos, change brightness, or fix colours.
  • Programming: Making games or apps often needs you to set colours using RGB values.
  • Web design: Websites use RGB codes to set background and text colours.
  • Digital art: Artists use RGB to mix colours on a screen, just like mixing paints.

Worked example

Let's say you want to make a pixel pure yellow on your screen.

Given: To make yellow, mix red and green light fully, no blue.
Step 1: Write the RGB values: R = 255, G = 255, B = 0
Step 2: The pixel will glow with full red, full green, zero blue.
Step 3: The screen shows this pixel as yellow.

Common mistakes

  • Thinking pixels are always square: Pixels can be any shape, but most screens use squares for easy arrangement.
  • Confusing RGB with paint mixing: Mixing red and green paint gives brown, but mixing red and green light gives yellow.
  • Believing more colours need more pixels: More pixels give higher detail, not more colours. Colour depth (bits per pixel) controls how many colours you can show.
  • Forgetting about brightness: Lower RGB values make darker colours, not just different ones.

Remember it

Just like mixing different amounts of red, green, and blue powders makes many rangoli colours, mixing red, green, and blue light in each pixel makes all the colours you see on your screen.

Check yourself

What are the three main colours used in digital images?

Red, green, and blue (RGB), because our eyes are sensitive to these.

Why does mixing red and green light make yellow on a screen?

Because our eyes see the mix of red and green light as yellow, due to how our cones work.

How many colours can you make with 8 bits for each RGB value?

16,777,216 (256 × 256 × 256), since each colour can have 256 levels.

If a pixel has RGB values (0, 0, 0), what colour will it show?

Black, because there is no light from any colour.

Quick recap

  • Digital images use pixels, each with red, green, and blue values.
  • Mixing different amounts of RGB light creates millions of colours.
  • The RGB model is based on how our eyes see colour.
  • Screens use RGB; printers use a different system (CMYK).
  • Changing RGB values changes the colour and brightness of a pixel.
Written by the LLOS.ai tutor. Asked by Anonymous on 22 Oct 2026, 11:23 PM IST