Meeting 7

Chi va piano va sano e va lontano

Topics: Pixel Math, more about Selections,

Files needed from the server:

Exercise Folder Filename
#1 musicians.tif & clocks1.tif
#4 ferrari wedding.jpg
   

Pixel Math
Pixels/inch is a measure of resolution. The terms dpi (dots per inch) and ppi (pixels per inch) are sometimes used interchangeably, although pixels per inch is more accurate. They are both measures of how many pixels fit into an inch of length. For most pictures in Photoshop, the resolution is the same whether measured vertically or horizontally. This is because the pixels in most images are square, and are the same size in both the vertical and horizontal directions. Some video applications however use non-square pixels and the vertical resolution may be different from the horizontal, but this class will not deal with this special case.

Pixels by themselves have no inherent size. When coupled with a resolution number however, their size becomes prescribed. For example, saying a picture is 800 pixels wide tells me nothing about how big it will print or be displayed. If you say that a picture is 800 pixels wide at 264 pixels/inch for an iPad Retina display, then the picture size can be calculated (800/264 = about 3 inches)

Handout resolution equations (res_equations.wpd) in class and go over examples.

For those who have learned formula triangles, here is the example to use for the equations give above.

Usage: If you cover up the item you are trying to calculate, the formula is revealed by the position of the remaining two parts of the triangle. For example, if you cover resolution,  pixels over inches remains. By dividing pixels by inches as suggested in the graphic, you get the desired resolution. Another example - if you want to find pixels, cover it up in the triangle, and inches x resolution is the formula because inches and resolution are located side-by-side.

Example 1a - you know the number of pixels in each edge and the resolution, find print size.

Example 1b - you know the number of pixels in each edge and the resolution, find print size.

Example 2 - you know the print size and the resolution, find the number of pixels.

Example 3 - you know the print size and the number of pixels, find the resolution.

Photoshop shows resolution in the Image>Image Size command. TIP: Click and hold on the numeric information shown in the lower left corner of the window to display mode, resolution, pixels, and print size without having to navigate to the Image>Image Size command.

Files can start out large, and can be resized down by resampling (reducing the number of pixels in the picture), but realistically cannot be resampled upward in resolution or number of pixels in an attempt to restore detail. Missing detail cannot be replaced by simply upsizing. Open Grayscale church (Exercises 1), resample to 12 pixels/inch, then resample back up to 72 pixels/inch to see the effect.

Line Screens in Printing
There are often questions about how the resolution of a picture (pixels/inch) interacts with the lpi (lines per inch) of halftone dots when printed. Lines per inch is a printing specification for a halftone screen use for printing, and not a characteristic of a picture file itself. When sizing pictures for printing, the rule of thumb is to double the lpi number to figure how many pixels per inch you need for your digital picture. For example, a picture that will be printed in a magazine at 133 lines per inch (lpi) will need to be double that number in resolution  (2x133 = 266 pixels/inch). This assumes that you will not be enlarging or reducing the picture.

Short quiz on figuring different picture sizes and pixel sizes and resolutions. (Resolution quiz.wpd).

100% View in Photoshop
One important thing to remember is that the 100% view in Photoshop is most likely NOT the size at which the picture will print. It is the size at which each pixel in the picture is displayed on one screen pixel. I have a series of pictures here that might help to explain why for the curious.

Resolution in Web Browsers
In another page, I've postulated that most web browsers ignore resolution tags in the file. This page has two pictures, one at 300 pixels/inch and a second at 72 pixels/inch. The often quoted web standard is 72 pixels/inch, but you can see on the page that it really makes no difference. It's the actual pixels that make up the image which determine its size when being displayed, not the resolution tag.

The Challenge of New Display Technology
Things are changing due to the introduction of new modern display technologies such as Apple's Retina displays (new iPad = 2048 x 1536 pixels in a very small size). They have a MUCH higher resolution than traditional screens. There are a lot of pixels packed into a small size. See the table below.

Web designers now are faced with incorporating code that automatically detects what kind of screen is being used by the client, and incorporating methods for scaling pictures to suite the device. More pixels will be delivered to very high resolution (i.e. Retina) screens, and fewer to traditional screens. Older web sites with once-functional pictures may look poor when upscaled to fill the available pixels on a modern device like a Retina-screen iPad,  unless accommodation is built into the web-site code.

Some Apple Retina resolutions are:

Model Pixels/inch Screen Size (pixels)
iPod Touch - 4th generation 326 960 x 640
iPod Touch - 5th generation 326 1136 x 640
iPhone5 326 1136 x 640
iPad - 3rd & 4th generation 264 2048 x 1536
MacBook Pro w/ Retina display 13" 227 2650 x 1600
MacBook Pro w/ Retina display 15" 220 2880 x 1800

By comparison, most other modern computer LCD screens are around 100 pixels/inch, comprising ~1920 x 1200 pixels. A large, modern HD television usually has 1920 × 1080 pixels.

Note that web developers often call resolution "pixel density". It's another term for the same thing.

Changing Resolution in Photoshop

Keep one principle in mind when changing the size of an image - it's potential for quality is determined solely by the number of pixels (horizontally and vertically) of the image. Resolution or print size (inches) specifications alone may be misleading!

To change resolution of an image,  use the Image>Image Size dialog box. It lets you change print-size, resolution, and the number of pixels in an image. It can be tricky to use though if you don’t understand certain principles.

Pay special attention to the choices in the Image>Image Size dialog box when you change resolution or size of your image. In particular the Resample Image checkbox affects profoundly the way that Photoshop handles resizing or resolution changes.

Practice using this dialog box and learn what the different controls do. Notice when things are grayed out and understand why they do so when certain choices are made.

  Resample Image box checked - you can add or reduce pixels   Resample Image box not checked - no pixels are changed

Example 4 - Resample Image is Unchecked

Example 5 - Resample Image is Checked

Example 6 - Resample Image is Unchecked, combined with further pixel math

More About Selections
Open the file ferrari wedding.jpg (Exercises 4) for the following exercises:

Select>Color Range... opens a dialog box where you can select things based upon color much like the Magic Wand tool, but it has other options that make it more powerful. The Fuzziness slider works like the Tolerance control in the Magic Wand, but you can preview the selection in a window. You can add additional colors to the selection using the "+" eyedropper tool, and remove colors from the selection with the "-" eyedropper tool.

Use Select>Color Range to try selecting the red car.

After you select the car using Color Range, experiment a bit with Image>Adjustments>Hue/Saturation and slide the Hue slider back and forth.

Modifying Existing Selections
After a selection has been made with any selection tool (i.e., Magic Wand, Marquee tool, Lasso tool, etc.), further changes can be made to the selection afterwards.  Some choices under the Select menu item include...

Select>Similar has already been discussed, but it's a way to select a similar colors throughout the entire picture.

Select>Grow expands a selection to include more colors or tones than what has been selected. For example, if you use the Magic Wand tool to click on a the red car, the Grow command will expand the selection to include somewhat similar colors. Each time the Grow command is used, additional nearby colors or shades of gray are selected.

Deselect when you are finished (Select>Deselect or type Command-d)

Open Musicians.tif
Select>Modify>Expand (or Contract) lets you add (or subtract) a given number of pixels around a selection. You specify the number of pixels to be added (or subtracted) to the selection in the dialog box that appears when you choose either of these options. To experiment with this, make an elliptical selection (using the Elliptical Marquee tool) above the man's head in the musician's picture to give him a "halo" selection. Make the "halo" larger or smaller using the Modify>Expand or Modify>Contract items.

Use Select>Transform Selection to rotate, skew, or scale a selection. You can make the "halo" above the musician more "jaunty" by giving at a bit of a backward tilt.

Select>Modify>Border changes a selection to an outline of the selection. You can control the number of pixels for the selection width in the dialog box. For example, a circular outline selection becomes a thin ring selection after using Border.

Select>Focus Area is way to select only the sharp parts of a photo, and not select the soft areas that are out of focus.