Sizing Digital Images

What do we mean by the size of a digital image?

Dandelion pictures superimposed and reducedIn the last week one computer client asked me why I don’t blog more on digital photography and someone else asked me to clarify how you change the size of image files. This kind of technical advice is probably better imparted in a 1:1 computer training session, but let’s see if I can help at least two clients in one go.

On this subject, it’s easy to conflate two different things and get thoroughly confused. These two things are:

  • The amount of information there is in the digital image and, therefore, the amount of space it takes to store it.
  • The physical, measurable size of the image if we print it or view it onscreen.

1) Information in an Image

As explained in a previous blog on digital images – a bitmap digital image (the more common type of digital image) can be thought of as a grid of tiny squares in which each tiny square is a single colour. A single square (known as a “pixel”, meaning “picture element”) can only be a single colour. So, if you have an image that is broken down into a grid of 1000 squares across and 1500 squares down then you have a picture comprised of 1,500,000 pixels. That figure is one way of describing the size of the image. Another way of saying this would be “One and a half million pixels” or, as you will see written on the point of sale literature for cameras, “1.5 mega pixels”.

The next aspect is to consider how much information there is in a single pixel. If the image is a “greyscale” image, containing only black, white and varying shades of grey in between, then each pixel is likely to be assigned one of 256 different shades of grey (including the black and white at either end of the scale). If we wish to record/describe the colour of any pixel then we can assign a number from 1-256 (representing each colour from white to black) to each pixel.

So, the total size of the image in terms of the amount of space it takes up on your computer or camera is the number of pixels (1,500,000) multiplied by the amount of space required to define the colour of each pixel. As it happens, it takes 1byte to define any of 256 colours so our image is going to be about 1.5mb in size. If this is a colour image in which each pixel can be a combination of any of 256 shades of red, green, and blue (known as an 8-bit RGB image) then we will need 3 bytes to define the colour of each pixel so the total size of the image will be 4.5mb.

This is a slight simplification of the actual size of the file, but the reasoning is sound. The file is likely to be slightly larger in practice because it will also contain other information known as “meta data” that doesn’t form part of the image itself (eg information about when the image was taken, the settings of the camera etc). Going in the other direction, though, if the image is a digital photograph then it’s highly likely that it will be in a “jpg” format – in which case the file will be “compressed”, thereby making it smaller (but we needn’t go into that here).

So, if you wish to email an image or upload it to a website and know that there is an upper limit to the size of the image, then it is the factors above that you need to consider – see this blog on emailing large attachments. If you’ve prepared your image in an editing program such as Photoshop and the resulting file size is too big then you need to do one or more of the following:

  • Crop the image (chop bits off it)
  • Reduce the “colour depth” (number of different colours available for each pixel)
  • Increase the compression at the expense of quality (if it’s a jpg, for instance)
  • Change the number of pixels into which the image is divided.

Photoshop Dialog Box for Image SizeIt is the last of these options that we are going to consider here. Look at the dialog box in Photoshop for changing the number of pixels in an image. Note that we haven’t yet mentioned “dpi” and we don’t need to! DPI has nothing to do with the size of the image as it sits on your computer or flies through cyberspace. Just change the number of pixels in the dialog box (under “Pixel Dimensions”) and the size of the image is immediately changed. And note that since we are working in two dimensions, halving the size of each dimension (height and width) would quarter the size of the resulting file. The easiest way of reducing the size of the file is to reduce the number of pixels it contains.

2) Displaying an Image

When displaying an image on a computer screen, or printing on a deskjet or laser printer, the image is made up of “dots” or “pixels” as created by the computer or printer. The density of these dots is what defines the size of the physical result.

So, if we have an image of 1000 X 1500 pixels and print it at a density of 200 dots per inch (dpi) then the printed image will measure 5 inches by 7.5 inches.

If we increase the number of dots per inch we will be packing the pixels closer together. This means that the image will (a) appear sharper (within limits) and (b) be smaller when it is printed.

So, if we print the same image at 300dpi then it will measure 3.3 X 5 inches when printed.

The crucial thing to appreciate is that we haven’t changed the size of the image itself. It’s still 1000 X 1500 pixels and it will still take up the same space on the computer. The decision to print it at 200dpi or 150dpi or 300dpi is separate from the size of the image itself. In practice, whatever your printer tells you it is capable of producing, you are unlikely to see any difference in printed quality if you raise the density (or “resolution”) higher than 300dpi but if you drop it to less than 150dpi you are likely to see the quality drop.

I’m not suggesting that there is no connection between image size and printing resolution. Clearly, whatever the resolution, the printed image will be larger if there are more pixels to print and if there aren’t enough pixels available then printing in lower resolution to get a larger print will reduce the quality of the printed result to unacceptable levels.

The important point I’m trying to make here, though, is that “dpi” has nothing to do with file size. Changing the “dpi” will not change the size of your file.

See this Wikipedia page on dpi for more detail on this topic.

You may also like to refer to these previous blog posts:

File Sizes
File Sizes – 2
Checking File Sizes