Bitmap Images

a bitmap is the simplest way to

represent image data in a bitmap the

image is divided into small squares


pixels this very simple image of what

might be a cat consists of 256 pixels 16

across and 16 down and each pixel is

either black or white we can store this

information using binary digits by

representing a black pixel with a 1 and

a white pixel with a 0 with 256 pixels

in this image and each pixel requiring

one bit of storage this image takes up

256 bits of memory since a byte is 8


that's 32 bytes of memory and total this

was pretty much all a very early

computer could manage one bit per pixel

meant monochrome images not only that

but the pixels will rather large which

meant poor quality images if you make

the pixels smaller you can fit more of

them on the screen this means you have a

higher density of pixels the number of

pixels per square inch is a measure of

the pixel density pixel density is

commonly referred to as resolution and

it's usually given in dots per inch dpi

the higher the resolution the better the

quality of the image this image is 100

pixels across and 100 pixels down this

means there are 100 times 100 pixels

10,000 in total because this is a

monochrome image just one color each

pixel requires only one bit of memory so

this image takes up 10,000 bits of

memory with 8 bits and a byte

that's 1250 bytes and with 1,024 bytes

in a kilobyte that's about 1 point to 2

kilobytes of memory to display an image

in color

more than one bit is needed to describe

the color of each pixel this image is

using eight bits to describe the color

of each pixel since 2 to the power 8 is

256 there are 256 possible values for

any given pixel in other words each

pixel can be one of 256 different colors

the size of this image is also 100

pixels by 100 pixels so there are 10,000

pixels altogether with each individual

pixel taking up 8 bits of memory this

image requires 80,000 bits of memory

altogether that's 10,000 bytes which is

also nine point seven seven kilobytes

considerably more than the monochrome

image this image clearly has a higher

resolution and more bits have been used

to describe the color of each pixel the

size of this image is 960 by 640 pixels

and 24 bits have been used to encode the

color of each pixel with 24 bits there

are 2 to the power 24 possible colours

that's over 16 point 7 million colors

can you work out how much memory this

image needs pause the video now to give

it a go and I'll show you the solution

in a moment you'll probably need a

calculator so there are 960 x 640 pixels

all together that's six hundred and

fourteen thousand four hundred pixels

each individual pixel requires 24 bits

of memory or to put it another way each

pixel requires 3 bytes so the whole

image requires one million eight hundred

and forty three thousand two hundred

bytes of memory that's 1,800 kilobytes

or 1.7 six megabytes this is much more

typical of an image these days

to summarize the quality of a raw bitmap

image depends on two things firstly the

resolution that's the pixel density the

higher the resolution the better it's

going to look and secondly the color

depth that is the number of bits that

have been used to encode the color of

each pixel very early computers used one

or 8-bit color the images didn't look

good at all by today's standards later

came 16-bit color which was known as

high color and more recently 24-bit

color these days most images use 24 bits

to describe the color of each pixel

sixteen point seven million different

colors really is plenty an average pair

of human eyes can't distinguish between

more than about 10 million different

colors when it comes to so-called 32-bit

color in fact only 24 of the 32 bits are

used for color the other 8 bits are used

to control the transparency of the image

of course the better the quality of an

image the more of the computer's memory

it will need when an image is generated

in the first place for example by a

digital camera a rectangular array of

pixels is created some extra information

is also added to the file this includes

the number of pixels in each row the

number of rows altogether and the color

depth in addition to this essential

information other details like the

shutter speed and the focal depth that

we used by the camera to take the

picture or even details about the make

and model of the camera may be included

image processing software such as

Photoshop or fireworks might also add

extra data to the image file such as

captions or titles all of this is data

about the image data data about data is

called metadata it means that when you

save an image file it'll be slightly

bigger than you can calculate based on

the number of pixels and the color depth