Friday, 5 August 2011

Viva La Resolution!

The Myth of Resolution and DPI

One very common question that crops up when people are new to digital photography, and specifically to printing from digital images, is that of resolution. Many explanations I've heard use complex and incomplete analogies to try and explain this mysterious and oft misunderstood concept and end up being even more confusing that the reality. I figured that, rather than just posting the same stock answer over and over, I'd compile a complete answer in the form of a blog post.

What resolution is (quick version)

Resolution is defined as the ratio between the physical size of a picture (in inches) and the dimensions of the image in pixels. This is measured in Dots (or pixels) Per Inch. A resolution of 100 DPI means that here are 100 pixels for every 1 inch of physical media.

What resolution isn't

Before we go much further, a quick word about what resolution isn't. Resolution is not:

  • The size in pixels of the image (see: dimensions)
  • The number of megapixels of the camera that took it
  • Anything related to HD or SD or other marketting terms

What resolution is (long version)

As I have already explained, resolution is a ratio, rather than an absolute value. It is therefore calculated retrospectively, rather than defined up front. This is the first major stumbling block to understanding DPI: it is not a property of the image file itself. It is, rather, an more abstract value based on the respective sizes of the digital and physical images.

An example

Consider a JPEG file. It is a photograph taken by a 9 megapixel camera, and has dimensions of 4000 pixels by 2666 pixels. We need to display it on several types of media:

  • The computer screen, on a web page
  • A framed print that is 10x8 inches
  • A canvas print that is 24x16 inches

Display on screen

To display it on the computer screen, assume that the dimensions must be constrained to a maximum of 500 pixels wide, on the whim of our fickle web designer. We can scale the image using an image editor to produce a second image with dimensions of 500 pixels by 300 pixels.

When displayed on the web designer's monitor, the image has physical dimensions of approximately 5.2 inches by 4.2 inches. From this we can perform a calculation to determine the resolution (in dots per inch) of the display.

resolution = pixel width / physical width
           = 500 / 5.2
           = 96 DPI

The monitor can be shown to have a resolution of 96 DPI. That is, for every 1 inch of physical screen space, there are 96 pixels. This is the stanard resolution used by the Windows family of operating systems, although the actual physical resolution of your monitor varies model to model.

10x8 inch Framed Print

For our framed print, we need to follow a popular rule of thumb that a printed image should have a resolution of at least 300 DPI. This is to ensure that the individual points are small enough to prevent the image becoming pixelated. Let's check what the resolution of our image will be if we print at 10x8 inches.

resolution = pixel size / physical size
           = 4000 / 10
           = 400 DPI

Our image, when printed to 10x8 inches in size, will have a resolution of 400 DPI. This is more than acceptable for a high quality print. No worries here, then.

24x16 inch Canvas Print

For our canvas print, we may start to get a little concerned if we keep the 300 DPI rule of thumb. First we need to check the actual resolution of the image when printed to such a large size.

resolution = pixel size / physical size
           = 4000 / 24
           = 167 DPI

Oh dear, that's a bit low. About twice the resolution of the display, but only half the resolution of the 10x8 framed print. There are a number of things we could do to increase the resolution of the image:

  • Upscale the image using interpolation. This is how upscaling DVD players work.
  • Print the image smaller.
  • Print it anyway and accept the lower resolution

It's at this point that things could get sticky. The only way to get our target resolution is by printing smaller (which we shall assume is not acceptable for the sake of argument) or by increasing the dimensions of the digital image. In other words, by adding pixels where before there were none.

As I pointed out in the bulleted list, upscaling DVD players perform interpolation when displaying DVD quality video on a High Definition television. The dimensions of a DVD video frame are 720x526 pixels. The dimensions of an HD television are 1920x1080 pixels. Clearly a significant number of pixels need adding. Interpolation calculates what colour the new, imaginary pixels should be based on those surrounding it. It can make the image appear a little fuzzy, but it is better than just making each pixel bigger. This would result in pixelation, which is arguably worse than slight blurring.

Of course, there is secret option 3: print it anyway. The rule of thumb that printed images should be 300 DPI comes from the assumption that the viewer will be standing relatively close to the image. Between 10 and 24 inches, generally. If they were holding the image in their hand, or standing close enough to see fine detail, they would need to be viewing a high resolution image.

An image of 24x16 inches would generally be viewed from a much greater distance. If it was in a living room, it could be seen from between 3 and 15 feet away. Due to the viewer being further away, the pixels don't have to be as small because they wouldn't be able to see the fine detail from that distance anyway. Printing at 167 DPI may be perfectly acceptable for a 24 inch print viewed from 6 feet away.
This effect can be perfectly demonstrated. Next time you see a large (10 feet or more) video wall, go right up close. The pixels are almost an inch wide. A resolution of 1 DPI. And yet, when you go back to your seat and watch it, you can't see individual pixels. That's because the distance (usually tens of feet) affects the required resolution.

Setting the resolution in an image file

Most image editors allow you to set a resolution inside the image file. This usually defaults to 72 DPI for very old reasons (the screen resolution of the Apple Macintosh, circa 1995). The user can set it to whatever they want, and this is the source of much confusion. What happens when you change the resolution of an image by adjust the DPI?

The answer is very easy: absolutely nothing. No aspect of the image is changed except the value of the variable itself. The image is not scaled or resized, the number of pixels remains the same, no interpolation or other algorithms are run. Nothing. Not a sausage.

In actual fact, the resolution setting of an image is just a very clunky way of telling a printer how big you would like the image to be. If your printer accepts the resolution as stored in the image (rather than having to be explicitly told the dimensions of the physical output) then you can calculate the effective size of the image.

Default print size

If the resolution is left at its default, 72 DPI, and you are using your 4000x2666 pixel image discussed earlier, the physical size of the image would be:

physical width  = pixel width / resolution
                = 4000 / 72
                = 55.6 inches

physical height = pixel height / resolution
                = 2666 / 72
                = 37 inches

Printing a 4000x2666 pixel image at 72 DPI would result in a physical print of approximately 56x37 inches in size. That's pretty large, and would look completely terrible.

Maximum size at 300 DPI

It is very useful to know, assuming an ideal resolution of 300 DPI, what the maximum size of print you can make is before you start to lose quality due to low resolutions. This can be calculated in just the same way:

physical width  = pixel width / resolution
                = 4000 / 300
                = 13.3 inches

physical height = pixel height / resolution
                = 2666 / 300
                = 8.9 inches

So you could effectively make prints of up to approximately 13x9 inches in size without having to use a lower resolution than 300 DPI. That's very handy to know.

Calculating resolution for a particular target size

So we know how big we can print at 300 DPI, but what about if you have a particular image size in mind? Assume that you want to print a 6x4 print and need to know what resolution to enter (in DPI) in the resolution field. The calculation is exactly the same as we've been using all along.

resolution = pixel width / physical width
           = 4000 / 6
           = 667 DPI

That's it. Put in a resolution of 667 DPI and your 4000x2666 pixel image will be printed at a size of 6x4 inches. Perfect.

That's all, folks

That's really all there is to know about how resolution works. It's not a complicated subject, but adding metaphors about sandboxes, cake slicing and lemmings just makes it far more confusing than it really needs to be. Just remember these simple rules:

  • Resolution is a ratio of size in pixels to size in inches. Resolution is irrelevant if you don't know or care about the physical size of the image
  • The 300 DPI rule of thumb is just that; it doesn't always apply
  • Interpolation is preferable to simply making pixels bigger, BUT
  • No interpolation at all is best
  • It's always best to shoot the largest image you can and scale down

That's really it. Have fun!

No comments:

Post a Comment