Representing Other Information in Binary

Representing Other Information in Binary#

Lecture#

Panopto logo Representing Color

Overview#

The end of the “Encoding Schema” lecture mentioned how binary numbers are also used to represent things other than numbers, text, or characters.

binary comparison

What about color? If we use a single byte or 8-bits to represent color, we can represent a total of 256 different colors. However, we perceive a much wider range of colors, so to extend the palette we can represent colors using more bits.

mario

Consider the difference between the color palette on old video game systems as compared to what you see on your computer screen today. Mario is a great example. The original Nintendo used 8-bit color, but Super Nintendo used 16-bit color giving a wider range of colors to represent the graphics in the game.

Hot air balloons

In 8-bit color, each color is represented in 8-bits or 1 Byte giving a color palette of 256 colors. 16-bit color increases the number of colors in the palette by a factor of two, representing over 65,000 different colors by using 16-bits or 2 Bytes to represent each color (256 x 256 = 65,536).

RGB color circles

As with text encoding standards, there are many different color encoding schemas. We can represent color using discrete values for the primary colors red, green, and blue.

Color table

An RGB (red-green-blue) color system can be represented using hex or decimal values.

Mario

The Mario example featured 8-bit and 16-bit color. If you’ve ever seen Red-Green-Blue color sliders, you’ve seen a 3 byte (24-bit) color system in action.

Key Concepts#

Comprehension Check#

Clipboard icon Representing Color Comprehension Check

Application#

Q4: How would the colors Magenta, Cyan, and Yellow be represented in binary, hex, and decimal?