# Bit Depth, Colors and Digital Photos

1
2
3
4
5
222 reviews

## Abstract

How many bits of information are in a digital photo? It depends on how many possible colors there are. Learn how to choose the right number of colors and bits to post your photo on the web or send it to your best friend.

## Summary

Areas of Science
Difficulty

Time Required
Very Short (≤ 1 day)
Prerequisites
None
Material Availability
Specialty Item: Requires Adobe Photoshop or similar photo editing software
Cost
Very Low (under \$20)
Safety
No issues
Credits

Sara Agee, Ph.D., Science Buddies

## Objective

The objective is to investigate the relationship between the number of bits in a digital image and the number of colors and file size of the image.

## Introduction

A bit is the smallest unit of measurement regarding computer data. Each bit indicates one of 2 different states, on (represented by a 1) or off (represented by a 0). A single bit does not convey much information, but you can string bits together in binary codes to represent numbers, words, music, pictures, or any other type of computer data. In fact, all computer data is coded in binary numbers, and looks like a series of zeros and 1's:

00101011100100100101110110110101000000110111101001101010

For a digital photo, bit depth is the number of colors that can be shown in the image. Because the bits can only indicate one of 2 possible states (0 or 1), the number of colors can only be powers of 2. Some examples of bit depths (and the calculation of the decimal number for those of you who know exponents) for image files are: 2-bit (2^2 = 4 colors), 4-bit (2^4=16 colors), 8-bit (2^8=256 colors), 16-bit (2^16=65,536 colors), and 24-bit (2^24=16,777,216 colors).

"Every color pixel in a digital image is created through some combination of the three primary colors: red, green, and blue.  Each primary color is often referred to as a "color channel" and can have any range of intensity values specified by its bit depth.  The bit depth for each primary color is termed the "bits per channel."  The "bits per pixel" (bpp) refers to the sum of the bits in all three color channels and represents the total colors available at each pixel. " (McHugh, 2005)

The larger the bpp is, the more colors can be used in the image. The smaller the bpp is, the less colors can be used in the image. Since images with more colors contain more information, they have larger file sizes. In this way, the bpp of an image is related to the file size and the number of colors.

In this experiment you will change the number of colors in a digital photo and measure the effect on file size and bpp and download time. Will the file size and download time always increase if the bpp increases? How will changing the bpp of an image change the number of colors that are possible? Is the relationship linear?

### Terms and Concepts

To do this type of experiment you should know what the following terms mean. Have an adult help you search the internet, or take you to your local library to find out more!

• bit
• binary code
• bit depth (bits per channel)
• bits per pixel (bpp)
• file size
• byte

Questions

• What is a bit?
• How many bits will make a good quality image?
• How will the number of bits change the number of colors and the file size?

## Materials and Equipment

• computer
• color printer
• photo quality printing paper

## Experimental Procedure

1. On your desktop, create a new folder called "My Photo Experiment" and place a copy of your favorite photo in the folder (like puppy.jpg).
2. Open the photo in Adobe Photoshop.
3. Click on "File" and "Save for Web..." from the file menu. A dialog box should appear showing your image in a new window. Choose the "4-Up" tab from the top of the window:
4. Four copies of your photo should appear in the window. One copy will be your original, and there will be three more copies of your photo in GIF file format.
5. Next you will make a series of changes to the settings in each frame. You will change the number of colors in each frame to a different value by clicking on the drop down menu on the right side of the screen:

A cropped screenshot of the image settings window in the program Photoshop shows a drop-down menu where the number of colors displayed can be changed. The colors drop-down option is on the upper right hand side of the settings window. In this screenshot 128 colors is selected.

6. Each time you change the number of colors, you will see the information below the image change. Make sure you can locate the number of colors, file size and download speed:
7. Write all of the information in a data table:

 File Name Number of Colors Bits Per Pixel File Size (Kb) Download Time (sec) Speed (Kbps) puppy.jpg puppy1.gif puppy2.gif puppy3.gif

8. You will need to calculate how many bits per pixel are in each image by using the number of colors in the image. Use this table to match up the bits per pixel with the number of colors chosen:

 Bits Per Pixel Number of Colors Available 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256

9. Make graphs of your data from the data table. Each graph should highlight one relationship, for example:
• bits per pixel vs. number of colors
• bits per pixel vs. file size
10. You will also want to save a copy of each "trial" photo. Do this by selecting one of your photo copies and clicking on the "Save" button. Save the file with the corresponding file name from your data table:

A cropped screenshot from Adobe Photoshop shows an optimized image being saved in GIF format. At the top of the window, there is a text box to rename the saved image file and a drop-down menu to choose where on the computer to save the file. The window also incudes a save button (bottom right) to confirm the changes and save the image.

11. Save each picture as a new file in the folder on your desktop named "My Photo Experiment", naming each new file with a different name to keep track of your experiments (like puppy1, puppy2, puppy3, etc.). Keep all of the settings and file extensions (.gif) the same.
12. Print a copy of each picture on photo quality paper and label the image with the file name for your display board.
13. Arrange your photos in a row and compare the images. How did changing the bits per pixel and number of colors in the image change the quality of the photo?

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

## Variations

• To kick this project up a notch try counting the number of unique colors in each image. Photoshop can not calculate the unique colors used in an image, so you will need to use another program like PaintShop Pro, which is a shareware program available for a free download. Open each of your files with PaintShop Pro and choose Colors/CountColorsUsed. After a while PaintShop Pro will show a dialog box that tells you the number of unique colors in the image, (like 16,777,216). Does this number match the number you chose in the settings dialog box? Why or why not?

## Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Computers are essential tools in the modern world, handling everything from traffic control, car welding, movie animation, shipping, aircraft design, and social networking to book publishing, business management, music mixing, health care, agriculture, and online shopping. Computer programmers are the people who write the instructions that tell computers what to do. Read more
Career Profile
If you've ever watched a cartoon, played a video game, or seen an animated movie, you've seen the work of multimedia artists and animators. People in these careers use computers to create the series of pictures that form the animated images or special effects seen in movies, television programs, and computer games. Read more
Career Profile
Lights, camera, action! It takes more than actors to put an exciting motion picture movie together. It takes film and video editors and cutting-edge computer technology to make an exciting movie that people want to see. From the many thousands of minutes of film and video, the editor has to choose the best shots to tell a cohesive and compelling story. In addition to having an artistic bent, the film and video editor must relish working with complicated computer equipment. If you would like to… Read more

## News Feed on This Topic

, ,

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

#### MLA Style

Science Buddies Staff. "Bit Depth, Colors and Digital Photos." Science Buddies, 23 June 2020, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Photo_p009/photography-video/bit-depth-colors-and-digital-photos. Accessed 7 June 2023.

#### APA Style

Science Buddies Staff. (2020, June 23). Bit Depth, Colors and Digital Photos. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Photo_p009/photography-video/bit-depth-colors-and-digital-photos

Last edit date: 2020-06-23
Top
Free science fair projects.