Wednesday, September 29, 2010

Photoshop and Image Resolution Part 1

Please contact me via email:

“It is better to know some of the questions than all of the answers.”
— James Thurber

A solution to resolution
The issue of resolution still seems to confuse many digital artists and fine artists alike that use Photoshop to process their digital resource images. An “image resolution” query on Google will bring up a great many hits about this most basic and essential step in producing quality reference images, so I thought I would present my own take on the subject. Its really not that confusing, and a bit (well, a lot actually) of background information is in order before we jump in.

First a glossary of important acronyms you need to know:

SPI (samples per inch).  This is scanner and/or digital image resolution. The scanning or capture device takes a sampling of portions of the image. The more samples taken per inch, the closer the scan is to the original image. The higher the resolution (set by you or someone), the higher the SPI.

PPI (pixels per inch).  The number of pixels displayed in an image. A digital image is composed of samples (SPI) that your screen displays in pixels. The PPI is the display resolution not the image resolution but the two are frequently interchanged.

DPI (dots per inch).   This is a measure of the resolution of a printer. It refers to the dots of ink or toner used by an imagesetter, laser printer, or other printing device to print text and graphics. In general, the more dots, the better and sharper the image. DPI is about printer resolution ONLY. Please DO NOT refer to the resolution of your image file in DPI. It is wrong.

LPI (lines per inch).  This has to do with the way printers reproduce images in print media, simulating continuous tone images by printing lines of halftone spots (another and different SPI). The number of lines per inch is the LPI, also called line frequency or halftone resolution. A typical line frequency (LPI) for a high-quality magazine printed on glossy paper would be 175 lpi, for example; a newspaper would typically be 75 lpi.  Not discussed in detail in this post.

So then, just what is resolution,anyway? The American Heritage® Dictionary of the English Language: Third Edition, 1996, in its definition of resolution states:

...6. the fineness of detail that can be distinguished in an image, as on a video display terminal.

In other words, resolution — input or output — is a measure of the ability of a device to render fine detail. And as can clearly be seen from the above descriptions, in all cases, the higher the number, the better the image will appear.

What is important to understand is what happens between image input and final output. For those artists who are creating digital images, the scanner or digital camera is most likely the first tool that you will use to get your ideas into your favorite imaging software and onto the display monitor. The quality of a scanned or captured image is contingent upon the capability of the output device. Choosing an input or scan resolution based on the ability and limitations of the output device that will process the image is VERY important. For digital artists creating content for the world wide web, for example, the output device is a video monitor. For those artists working primarily in print, the output device would be an inkjet printer, laser printer or some other type of imagesetter. But monitors and printers work quite differently from each other, and the rules are different for images intended for both devices. And, as is often the case these days, the images we create will need to be “repurposed” for both.

What follows is an attempt to detail the significance of these differences and, in the process, demystify it. But first, there are a few things to consider about your image.

An informational record only
First, it has two states, an informational record, and a physical size. Attributing physicality to your raw or virgin image is a mistake. Its best to just think of your image as an informational record of a grid of pixels (short for picture elements), repositing on a hard drive in your computer as a file. Nothing more. When these pixels are small enough so as not be individually discernable, a digital image can achieve a photographic quality. Increase the magnification enough and the individual pixels will become readily apparent.

Secondly, forget, for the moment, a number such as 72dpi (dpi is wrong anyway, more about that follows). This is a number without any meaning -- an invented number, a relic from the days when computer screens often had a resolution of 72ppi. A misunderstanding took hold that an image on a screen or on a website is always 72 dpi, but nobody has a monitor that really displays at 72ppi. For an onscreen presentation 72 is a good number yes, but so is 96. For those who you are interested in this stuff, in a future post I will explain how to determine the ACTUAL resolution of your display monitor and why your images display onscreen the size that they do.

The number 72 is there at the bottom of Photoshop’s Image Size dialog because a box (field) has to be filled in, so the originator of the device that produced the image simply invents a number. It is usually 72, but is different from different originators. My Canon G10 camera, for example, defaults that number to 180. An image file stored on a Flash Card in a camera, on your computer, or wherever, has no size in inches or centimeters, hence no dpi (really ppi). Such a file only has a resolution, in pixels, referred to as Pixel Dimensions. Only when you are going publish your file, whether online, to an inkjet printer, or traditional print media (magazine, newspaper, direct mail, etc.) does the issue of physical size matter, and only then do you ascribe a dimension of physical measurement, normally given in inches or centimeters. And only then does the PPI -- number of pixels per inch -- (regrettably still called dpi), really matter.

This number, say 72ppi, is also known as Spatial Resolution and represents a variable property of an image file. It only becomes a fixed property of an image once it is output in some permanent form, like published in print, for example. Since this resolution is conditional upon output it is commonly called output, or print resolution.

Capturing the image data
But before that happens, its important to understand how the image was captured in the first place and the correct terminology for that is SPI or samples per inch, a measurement of image resolution that was set at the time of image capture by say a scanner or digital camera. A device takes a sampling of portions of the image measuring the value at a specific place in a scanned image. The more samples that are taken per inch, the closer the scan is to the original image because there is more information available about how the image should look. Thus, the digital image, composed of samples, provides INFORMATION about how to display that image. Its scanning or capture resolution is the amount and type of information stored for that image. Through RESIZING and RESAMPLING, the stored information of that image can change so that the image resolution is different from the original scanning resolution. PPI and SPI are often interchanged, causing a lot of confusion, but for the most they mean the same thing. Just remember that PPI is really a measure of DISPLAY RESOLUTION and SPI is a measure of CAPTURE RESOLUTION. Somebody, somehow, somewhere, had to enter a number to make your image have a reality as data that can be stored and manipulated and that’s what PPI or SPI is. I know this difference matters very much to purists but the resolution police will not come and arrest us if we just use PPI for the sake of the rest of this discussion.

How to do it right -- Image Size explained
Before I move on to concrete examples of what I have been talking about, I want to leave the the last couple of digital imaging anagrams, namely, DPI and LPI, for another detailed discussion post lest I thoroughly confuse you and cause you give up digital imaging altogether and go back to sketching and thumbnail layouts (the fine art purists will no doubt have my head for that last remark).

My camera is a Canon G10, a fine little machine boasting an image resolution of 14.7MP or 14 megapixels. So exactly what does that mean anyway? It means that at the highest quality setting (not necessarily, and usually not the default setting!) -- in my camera the “L” Large setting -- I can produce an image file that contains 14,625,792 pixels. This will, according to Canon, at an input resolution of 180ppi (Canon’s default input resolution) produce an acceptable 24 x 18 inch print. How do I know this? Let’s take a look at the Image Size Dialog (below) after opening the image in Photoshop, where we can find exactly what we need to know about the image file.

Image Size dialog of raw digital camera file

Resample Image unchecked; new resolution changes Document Size

The Image Size dialog is divided into two sections: Pixel Dimensions and Document Size. The Pixel Dimensions section contains two boxes, Width and Height. The dimensions and file size shown in this screen grab are of the full-size version of my image as it came out my camera BEFORE I gave it purpose, such as resizing it to something more suitable for a web page, or for use in print media, for example. Photoshop is telling me that my photo has a width of 4416 pixels and a height of 3312 pixels. In other words, it contains 4416 pixels from left to right, and 3312 pixels from top to bottom. To find out exactly how many pixels I have in my photo, I simply multiply the width x the height, which gives me a total of 14,625,792 pixels. Rounded up that equals 14.7 megapixels, the same megapixel image resolution of my camera. Pretty easy so far, right?

The second section is called Document Size and contains three boxes: Width, Height and Resolution. It says that at a resolution of 180ppi (pixels per inch) I can produce a print roughly 24 x 18 inches. Will this print be of an acceptable quality? Most likely it will, but I prefer to print at double the resolution or 360ppi which will yield a superior print, but at 1/2 the size or roughly 9 x 12 inches. Why is that? Take a look at the revised Image Size screen grab below. Its because Resolution and Document Size are inversely proportional to each other. So long as the Constrain Proportions box is UNCHECKED, I can enter any number I want into the box and the Document Width and Height will change proportionately. And, the Pixel Dimensions remain unchanged as does the File Size, which is 41.8Mb, a fairly large file. It goes back to what I was talking about at the beginning of this long discussion, that the resolution of an image is a number without any meaning -- an invented number -- totally dependent on the image being given a purpose, in the above case, proper resolution for photo-quality output to an inkjet printer.

Math Time

Let’s do some math now. Looking at the original image size at 180ppi, we have for pixel dimensions a width of 4416 pixels. That means for every inch in our output there will be 180 pixels. and for every inch in height there will be 3312 pixels. So then:

4416 ÷ 180 = 24.53
3312 ÷ 180 = 18.4

Haven’t we seen those numbers before? That’s right, those are the same numbers as in the first screen grab Document Size boxes.

4416 ÷ 360 = 12.26
3312 ÷ 360 = 9.2

Haven’t we seen those numbers before also? That’s right, those are the same numbers as in second screen grab Document Size boxes.

Now that’s all well and fine if you are going to produce an image that's the same size as the raw digital image file, but that is rarely, if ever, is the case. Lets say I need an image to output to fit a small photo album that accepts 4 x 6 inch prints. Obviously the Pixel Dimensions AND Document size are way too large for a 4 x 6 inch output size. Our image file now has a purpose! I know the new output size is 4 x 6 inches and I know I will printing to an Epson R2400 photo-quality inkjet printer at 360ppi, the proper resolution for high-quality photographic output. The maximum output resolution of this printer is 1440DPI (that’s right, dots per inch). New numbers will have to be entered into the proper boxes in the Document Size part of the dialog to reduce the Pixel Dimensions, hence file size. This is called resampling -- in this case downsampling -- and is easily accomplished by calling up the Image Size dialog once again. You can also upsample an image -- within a reasonable limit -- but I don’t recommened it until you really uinderstand a lot of other advanced Photoshop skills.

As I’ve said many times before in my image editing posts, there are many ways to accomplish the same thing in Photoshop. This method assumes that I do not want to apply some kind of special cropping to my image in which case I would use another method to downsample my image. I will discuss different methods of cropping images in a future post.

Resample Image unchecked; new width changes resolution
Downsampling is a simple two-step process within the same Image Size dialog. After opening the Image Size dialog, I make sure to UNCHECK Resample Image. Immediately the Width box is highlighted and ready to accept my new width, 6 inches. As you can see in the screen grab, the height changes automatically to 4.5 inches and the resolution changes to 736, way too much resolution for output to my printer. It is an inversely proportional relationship -- if one number goes up the other goes down, and vice-versa. The file still has not been given its purpose yet -- output to a photo printer -- so you’ll notice that the Pixel Dimensions numbers up top did NOT change.

Resample Image checked; new resolution results in smaller file size
Resample Image checked; new resolution results in even smaller file size
Next, you need to CHECK Resample Image and then enter 360 into the resolution box. You’ll see right away that the Pixel Dimensions Width is now 2160 pixels and Height 1620 pixels. And the Pixel Dimensions file size is now 10Mb. Since we reduced the physical size of the image by roughly 1/4, the file size was reduced from 41.8Mb down to 10Mb. If the image was also destined for viewing online I would have entered 72 into the Resolution box and the result would have been Pixel Dimensions Width 432 pixels and Height 324 pixels, with Pixel Dimensions file size changing to 410Kb, much less “weight” than the original hefty 41.8Mb original file.

Lastly, you will note that the downsample gave me a height of 4.5 inches but my crop size needs to be 4 inches (remember the final print needs to fit into a standard photo album sleeve of 4 6 inches). So I need to call up my Canvas Size dialog, decide whether I want to crop off some top or bottom or both, (I chose to crop the top) enter 4 into the Height inches box, hit the Enter key (or click OK) and were done. You’ll notice that when you crop off some of you image you are also throwing away pixels so the New Size dimensions will also get smaller as soon as you enter your new crop size.

Canvas Size dialog -- new height entered

 Now you can call up Save As, name and save the new file in the .psd format. NEVER save over an original file. The reason I suggest saving to native format (.psd) is because you’re not really done with the new file. Since you downsampled the file, you threw away a lot of data (pixels), so the integrity of your image has been compromised -- it got much softer. You still have some work to, namely Sharpening AND you still have to choose a colorspace by selecting Assign or Convert profile. Not to mention color/tonal balance using Shadow/Highlight adjustment, Curves, Apply Image....

But that’s stuff for future posts so please visit again soon!



No comments:

Post a Comment