Return to Pixlabs' HomePixlabs - Smart Digital Photography Software

 

Up

Digital Photo Reference
Photo Management
Microsoft .NET FAQ
Site Map

Home

 

 

Digital Photo Reference

There are a lot of confusing terms for those new to digital photography to learn.  Perhaps the most difficult are those that we use everyday, but have different implications in the different technologies that come together to make digital photography.  For example, "size" is just such a confusing term because this term means different things in photography, computers and compression technology.  When talking about printed pictures, it seems reasonable that size should refer to the actual dimensions of the picture in inches or centimeters.  For example, when you get your film pictures developed, the photo finisher may ask what size prints you would like.  If you live in the United States, your answer would be something like, "I'd like four by sixes please."  Of course this means that you would like the dimensions of your prints to be four inches by six inches.  If you talk to a web developer and she asks what size your images are, she may want to know how many bytes the image file takes up on disk because the more bytes required, the longer the download.  This would be only a minor problem if these two versions of size were directly related to each other.  However, because of compression technologies, and parameters like dots per inch (DPI), a digital image that produces a very large print may be stored in a smaller file than one that produces a small print.  Much of the complexity comes from a basic tension between amount of data and image quality.  Usually (but not always) a better quality image will also contain more data and produce larger files.  Because flash cards, computer memory, disk drives and computer networks are limited resources, file size should be minimized.  Because higher quality images convey more information, are more pleasing and interesting, we want image quality to be maximized.  So how do we unravel all of this?  Lets start by understanding some of the concepts:

Pixel

A Pixel is a "picture element."  In digital photography this is the smallest piece of an image.  Each pixel specifies a single color for a location in the image.  In the picture of the bird below, we have zoomed in on the eye to show the individual pixels.  Each square you see in the enlarged image is a pixel.  Its hard to believe that this jumble of dots looks like a bird's eye, but if you stand back from your monitor and blur your eyes a bit, you will see that it does look like an eye, just as it does in the picture of the bird from which it comes.

When all the pixels are put together, your brain interprets these pixels together as an image - a bird's eye.

Pixel Depth

In digital photography each pixel is represented by an number.  That number is displayed as a color by your computer on your screen or printer.  The number of bits used to represent each pixel is often referred to as "pixel depth."  A simple black and white image could be represented with a single bit (a 1 or 0) for each pixel.  That means each pixel would be either on or off, 1 or 0.  These numbers would then be interpreted as black or white. 

bit value pixel color color name
1   white
0   black

In this case each pixel must be either black or white.  There are no other options.  If you used 2 bits per pixel which can each be either on or off, there are four possible values.  You could interpret the possible values as 00 = black, 01 = dark gray, 10 = light gray, 11 = white. 

bit1 value bit2 value pixel color color name
0 0   white
0 1   light gray
1 0   dark gray
1 1   black

The more bits the more levels of gray you can represent with each pixel.  Below are three versions of the same picture using 1, 2 and 4 bits per pixel to display 2, 4 and 16 levels of gray respectively. 

As you can see, the more bits per pixel, the more realistic the image becomes.  However, the number of bits per pixel also influences the file size of the image.  The following equation tells the amount of data contained in an uncompressed image:

x dimension (pixels wide) * y dimension (pixels high) x bits per pixel (bits/pixel) = bits per image / (8 bits/byte) =  bytes per image. 

For example, an uncompressed 100 pixel x 100 pixel image with one bit per pixel will take 1250 bytes (~1.2k bytes) to store.

100 (pixels wide) * 100 (pixels high) x 1 (bits/pixel) = 10,000 bits / (8 bits/byte) = 1250 bytes. 

If the same image were used 4 bits per pixel we would have 4 times as much data (~4.9k bytes) to store or download.

100 (pixels wide) * 100 (pixels high) x 4 (bits/pixel) = 40,000 bits / (8 bits/byte) = 5000 bytes. 

By the way, in computer work there are 8 bits to each byte and 1024 bytes per kilobyte (k byte).  Some numbers may look a little funny because a computer kilo (1024) ≠ a metric kilo (1000) which may be more familiar. 

It is interesting to note that the image is just a bunch of numbers and by convention, computer programs interpret those numbers as certain colors.  For example, we could take the one bit per pixel image above and interpret 0 as white and 1 as black, the opposite of how it was interpreted above.  Or more interestingly, we could interpret 0 as blue and 1 as red.

By convention, cameras, printers and computers all agree on a few ways to interpret some standard types of pixels.  Computers usually use combinations of red, green and blue to represent color pixels because many digital cameras today use 24 bits per pixel to represent a color image.  In this format, 8 bits (256 possible values) are dedicated each to red, green and blue.  Each pixel can take on any of 16,777,216 different values which is any combination of 256 red, 256 green and 256 blue values.  Higher-end cameras often allow you to take pictures in a RAW mode that is a format that is often unique to each camera manufacturer, however, it may capture as much as 12 bits (4096 possible values) per color per picture for a total of 68,719,476,736 unique values.

Resolution

Resolution is the number of pixels in the image.  When you hear about the number of megapixels in a camera, this is defining its resolution.  This is usually expressed as something like 3072 x 2048 pixels which means that there are 3072 pixels in the x (horizontal) dimension and 2048 pixels in the y (vertical) dimension.  You will notice that 3072 pixels multiplied by 2048 pixels equals 6,291,456 pixels or roughly 6 million pixels which tells us that this image came from a 6 megapixel camera.  This means that this camera is able to "resolve" (a word closely related to resolution) over six million unique picture elements of color in a single image.  A 3 megapixel image may have a resolution like 2160 x 1440 for its images.  2160 pixels multiplied by 1440 pixels equals 3,110,400 or roughly 3 million pixels.  It is interesting to notice that 3072 x 2048 may not seem like double the size of 2160 x 1440, but in fact it is because it takes twice as many pixels to make up the larger image, so thus it is indeed twice the resolution.


DPI/PPI

Dots per inch (DPI) or pixels per inch (PPI) both specify the intended size of a pixel in the image.  This along with the resolution will determine the size of a print.  For example, lets say you have a 100 pixel x 100 pixel resolution image.  If you print it at 100 DPI, you will get a picture one inch on a side (100 pixels at 100 pixels/inch = 1 inch).  If you print at 1 DPI, you will get a picture that is 100 inches on a side (100 pixels a 1 pixel/inch = 100 inches).  Note that the resolution hasn't changed.  There is no more detail in the large picture than in the small picture.  Its just that you will see individual pixels from several feet away on the 1 DPI  image, while the 100 DPI image may required a magnifying glass to see the pixels. 

The printer driver on your computer is able to interpolate to create different sized printed images based on different DPI settings.  Generally your choose an image size and let your computer figure out the exact DPI.  However, for the absolute optimal results, choose a DPI that matches the resolution of your printer.  It can sometimes be difficult to determine exactly what this number is, but if you read the printer's specifications, they often will list it.  Sometimes you can take the "marketing" number that a printer lists (for example some Epson printers claim 1440 DPI) and divide by the number of colors (in this case 6 colors) to get the true DPI (in the example this would be 240 DPI).  You may find that images printed at this resolution or exact multiples (120 DPI, 480 DPI etc) print slightly better because the printer driver software does not have to manipulate the image as much.

Compression

Compression is used to save disk space and speed download of images.   Most digital cameras offer options for compression of the images they take. 

Although there are several different kinds of compression, most cameras use JPEG (Joint Photographic Experts Group) compression.  The picture of the bowl of apples below is 220 pixels high by 170 pixels wide and each pixel is 24 bits.  Based on the equation we used earlier we know that this is roughly 110k bytes worth of data.

220 (pixels wide) x 170 (pixels high) x 24 (bits/pixel) = 897,600 bits / (8 bits/byte) = 112,200 bytes ~= 112k bytes..   

The JPEG standard actually provides for many different qualities of compression.  For comparison, we also include a GIF (Graphics Interchange Format) compressed image just to see a different format of compression. 

As you can see in the images above,  the high quality JPEG image looks quite good and is 12 % the amount of data as the original file.  This means this image is about 8 times faster to download on this web page than the original would have been.  It is also about 8 times smaller when stored on a disk drive or on the compact flash card of your camera.  The low quality JPEG would be even faster to download and even smaller when stored, however, it is visibly blurry and it is not suitable for applications where high quality is required.  Usually there is a tradeoff between quality and file size.  The GIF image above is a contrived example to show that not all compression schemes are appropriate for all situations.  Although GIF compression can produce very nice images, in this case we created an image that is nearly as large as the high quality JPEG image and yet still quite low quality.  

All the images above have the same number of pixels.  How does the same image get squeezed into a different number of bytes in a file?  Compression is used to mathematically omit information from the file in a way that can be reconstructed or approximated later when the image will be reloaded.  Compression techniques that can exactly recreate the omitted portions of the image are called "lossless."  Techniques that cannot guarantee that the image will be exactly recreated, bit for bit, are called "lossy."  In general, lossless compression results in a much larger file than lossy does, so usually lossy techniques are more practical.  The best lossy schemes are the ones with artifacts (the differences between the original image and the reconstructed image) that are not very perceptible or displeasing to the human eye. 

Many of today's digital cameras provide different shooting modes that will produce different "size" images.  Often they allow you to shoot at several different resolutions and compression levels.

Two important  implications of lossy compression (JPEG):

bullet

The loss in quality is cumulative.  (every time you compress the image you lose a little more - and this happens every time you save in many programs!)

bullet

Once quality is lost it cannot be recovered. Saving an image at high quality will not recover quality lost when when an image was saved at a low quality earlier.

This means that if you decompress and recompress and image over and over, the image will lose more and more quality.  The artifacts add up.  JPEG compression is a lossy compression scheme and is thus prone to this problem..  Unfortunately, this is exactly what happens when a JPEG image is opened and resaved in many image editors.  In many programs, even rotating the image will cause loss of quality.  Over the course of several editing sessions, an image can be severely degraded.  This is why most professional photographers keep the original images intact.  That way they can always return to the original to work with the highest quality images. 

 privacy policy
legal information

Copyright © 2003 Pixlabs.  All rights reserved.