Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ò Bit Depth

GRAPHICS KNOWLEDGE

ò Bit Depth

by  SPYDERIX  Posted    (Edited  )
[color blue]What is Bit Depth? How does bit depth and file size relate?[/color]

A bit is a binary digit, which can only have a value of 0 or 1. The colour of each pixel is stored in just 1 bit of space in the computer. Bit depth is the number of bits in each pixel. Color depth is the maximum number of colors in an image and is based on the bit depth of the image and of the displaying monitor.

Color Resolution (color depth) is the number of bits of data used to store information about the color of each pixel in an image. This is also known as bit depth or color depth. The higher the color resolution, the greater range of possible colors in the image, and the larger the file size. Typical color resolutions are 8-bit, 16-bit, or 32-bit, although others are possible.

Bit depth defines the number of colours available to each pixel within an image:

Bit Depth Colours Available
1-bit black and white
2-bit 4 colours
4-bit 16 colours
8-bit 256 colours
8-bit greyscale 256 shades of grey
16-bit 32768 colours
24-bit 16.7 million colours
32-bit 16.7 million + 256 Levels of transparency

8-bit image = 256 colours
With an 8-bit image, each pixel can be one of 256 colours.

24-bit image = 16 million colours
With a 24 bit image, you have 16 million colours, made up from 256 shades of red, 256 shades of green and 256 shades of blue.

All the colours are made up from varying amounts of these primary colours, so for example, 0,0,0 would be black and 255,255,255 would be white. 255,0,0 is red. 0,255,0 is green and 0,0,255 is blue, 255,255,0 is yellow, 255,0,255 is magenta and 0,255,255 is cyan.

Each value of 0 - 255 takes up 8 bits, so the total amount of space to define the colour of each pixel is 24 bits.

Bit = binary digit
Byte = 8 bits
Kilobyte = 1024 bytes
Megabyte = 1024 kilobytes

So to figure out the file size of a 24 bit desktop wallpaper 1024 X 768 you:

ò multiply the width and height in pixels (1024*768 = 786432 pixels)

ò the bit depth is 24 bit image(16.7 million colors)
and 24 bit depth divided by 8 bits/byte = 3 bytes.

ò Multiply that by the number of pixels 786432 by 3 bytes = 2359296 bytes

ò 2359296 divided by 1024 bytes/kilobyte = 2304 divided by 1024 kb/mb = 2.25MB file size.


NATE

[img http://www.mainframe-webdesign.com/tt/mainframe.gif]
http://www.mainframe-webdesign.com
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top