ImageGear for C and C++ on Linux v18.8 - Updated
4-bit and 8-bit Images
User Guide > Concepts > Understanding Bitmap Images > 4-bit and 8-bit Images

A 4-bit image is simply one in which each pixel is represented by 4 bits. Therefore, a 4-bit image can contain 16 (24) colors, each pixel having a numerical value between 0 and 15. The color palette for a 4-bit image will therefore normally have 16 entries (0 - 15.) As a 1-bit image might be called a 2-color image, a 4-bit image is also called a 16-color image.

In an 8-bit image each pixel occupies exactly one byte. This means each pixel has 256 (28) possible numerical values, from 0 to 255. Therefore, the color palette for an 8-bit image normally contains 256 entries, defining color 0 through color 255. 8-bit or 256-color images are very common because the availability of 256 unique colors provides adequate or even excellent color resolution for most purposes. Also, when operating upon an image in memory, such as when performing image analysis, transformations, or other image processing, operating on an 8-bit image is much faster than performing the same operations on a 24-bit image. And, of course, an 8-bit image uses only about one-third the memory or file storage space as a 24-bit image.

Because each pixel value of a 1, 4, or 8-bit color image is used as an index into a color palette, these images are sometimes called "indexed color" images. In this manual, 8-bit color images are sometimes referred to as "8i" images, to distinguish them from 8-bit gray level images, which are described below.