Image encoding

Today, all digital data is represented using a binary code. This is true for all data types: video, text, numbers, speech, music, etc. For example, the ASCII code is often used for text.

How might we encode an image?

Here is a picture of a house like the ones you drew when you were very small and one binary code that could be used to represent it:

Color Code
blue 0000
light green 0001
dark green 0010
yellow 0011
orange 0100
red 0101
purple 0111
light grey 1000
dark grey 1001
brown 1010
black 1011
white 1100

This image has only 12 unique colors, so we could represent it using a 4-bit code. More than 16 colors would require more bits in our code, and with fewer colors, we could possibly get by with less.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.