Meeting 3

Chi fa da se' fa per tre (e per altri trentatre)

Topics: File naming conventions, opening PC files on the Mac, review of Tools, photo retouching, toning with Levels, more Magic Wand selections, quickly leveling horizons, changing perspective, content aware scaling

File Naming conventions.
In a mixed platform world of Macintosh, Windows, and Unix computers, you must pay attention to how you name your file. On PCs, you usually append a three-letter file extension after the file name to tell the computer what program to launch when it is double-clicked. Programs on the PC do this automatically, but the same programs running on the Mac often do not. However by default Photoshop (starting with version 5.5) appends the proper file extension to various file formats, i.e. JPG, TIF, PSD, etc. This is a Photoshop preference that can be altered, but unless there is an unusual need, do not change it.

Never, NEVER simply select the file extension and change it (i.e. myfile.tif --> myfile.jpg) in an attempt to change the file format. That does not work! You must instead resave the file from within Photoshop in the new format you wish to use.

There are additional things you should avoid when naming files for use on all platforms (i.e., web images, multi-media/CD presentations).

Things to avoid:

Don't use odd punctuation or characters in the file name. For example, don't use #. %, forward or back slashes, ampersands, and question marks or any other strange glyph. Stick mostly to letters and numbers. Dashes and underscores are good for separating words.
Good: my_file.jpg
Bad: my/file.jpg

Don't put more than one period in the file name. Use only one period at the end of the file name just before the three-letter suffix.
Good: very_big_splash.jpg
Bad: very.big.splash.jpg

Don't omit the 3-letter suffix. Add the correct 3-letter suffix to the file name if none is created by the application program. ALL web browsers require a suffix to be able to tell a picture file from a text file, for example. Don't add inaccurate suffixes either. If you name a TIF file "goodpicture.jpg", the picture won't display properly on a web browser. For a list of PC file name suffixes, go to suffix.html.
Good: promo_pic.gif
Bad: promo_pic.newone
Bad: promo_pic

Avoid spaces in filenames. High-speed Unix-based web servers dislike having spaces in the file name. Your pages and files with spaces in the name may work on a Mac or PC server, but if you ever migrate the files to a Unix server, you're could be in trouble. Most experienced web designers use underscores in the file name to separate words for clarity.
Good: my_new_car.jpg
Bad: my new car.jpg

Note that spaces in a web address are replaced by confusing "%20" symbols on the url. Click this link and look at the url line on the web address to see the confusing text.

Opening PC files on a Mac:
Opening a PC-created picture file (like a jpg) on the Mac often confuses beginning users. They usually double click the icon, and some other program on the Mac opens the file for viewing - usually Preview or Apple QuickTime. The file is not loaded into Photoshop like they expected.

Macintosh files contain a hidden piece of information called the Resource Fork. The Resource Fork tells the computer what program to use when a file icon is double-clicked. Each program that creates a file writes this information when you save. When you copy a PC file onto the Mac, the resource fork is missing. In order to open a file created originally on a PC, you usually have to launch the program first (i.e. Photoshop), then do a File>Open from within the program. Once the file is re-saved, the missing resource fork is added, and the file becomes a Mac version.

A keyboard shortcut way to open picture files created on a PC or in a different Mac program is to hold the Control key down when you click on the picture. That pops up a dialog box that includes Open With.. in which you choose Photoshop.

A final way to open PC files on a Mac is to drag the file onto the program's icon on the application bar.

Reading Mac files on a PC
There are two potential problems reading Macintosh files on a PC. One problem is reading the disk itself - while Macs can read PC-formatted disks, PC's can't read Mac disks unless you purchase additional software. DataViz's MacOpener is PC software that permits reading of Mac disks, and it works very well. It costs about $50 for a single user license. Go to http://www.dataviz.com/products/macopener/index.html for more information. The flash memory keys and external hard drives using FAT32 formatting are usually read by both platforms equally, so they don't present the any problem or require additional software.

The second potential problem is opening the Mac file once it has been successfully copied to the PC. Unless the file has the proper three-letter filename extension, the PC will not usually be able to open the file. Be sure to save Mac files with the three-letter extension that belongs on that file type to avoid difficulty.

Brief review of Meeting 2 topics - the tools in Photoshop.

Photo retouching

Open Clocks1.tif in Exercises 1.

Review: Start by trying to select the background with the Magic Wand. Edit>Undo - (shortcut is Command-Z for Undo).

As discovered in the last lecture, the Magic Wand tool won't work on the gradated-tone background. When you click on a color, it looks for similar colors to select. When the colors or tones are different enough, they won't be selected.

Try using the Magnetic lasso tool (click and hold on the lasso tool icon to display it) but notice how it fails in areas where image tone matches background tone.

Try the Magnetic lasso again, but hold the Option key in troublesome areas to permit temporary manual override of the automatic selection function. Release the Option key in areas of high contrast to resume automatic selection of image edges.

When you are making an INITIAL selection, hold the Option key to prevent the regular lasso tool from closing and to easily create straight lines in the selection. Click and hold to continue drawing curved selections. If you have the straight line lasso tool selected, hold the option key to create curved lines. Remember that the Option key changes behavior once a selection has already been made (it subtracts from an existing selection).

Select>Inverse and fill with a different color gradient. (Select> Inverse chooses opposite parts of the picture from what was selected previously.)

Don't forget how to modify selection areas -- subtracting from selection (Option key), adding to a selection (Shift key).

Selection tool tip: If you are switching between the rectangular and the ellipse marquee tools, press Shift-M to toggle between them.

Levels vs. Brightness and Contrast
Open musicians.tif (Exercises 1) for in-class exercise.

Image>Adjustments>Brightness/Contrast vs. Image>Adjustments>Levels.
(Levels is almost always preferred over Brightness/Contrast adjustments -- but there was a change to the control back in CS3 to make the Brightness/Contrast tool more useful. Still, Image>Adjustments>Levels is preferred if only because of the histogram provided in the dialog box.)

NOTE: When toning on a flat LCD screen, the tilt of the screen affects picture tones. In the VisCom Imaging lab, we use a tiled screen background image that helps you tilt the screen properly for more accurate toning of pictures. Click here for a web page that explains how to do it. This information was also published as an article in More Mastering Digital Photography, Preston Publications, 2004.

One thing to watch when toning is that you don't fall into the trap of adjusting the picture tones with multiple iterations of Levels, and clicking OK each time. It's best to obtain optimum picture tones in a single edit of a picture to minimize histogram "combing" and ugly posterization. Posterization will be most apparent in the darker tones of a picture.

TIP: Hold the Option key (Alt key on a PC) when you use Levels adjustments to see what parts of the picture get "clipped" when making adjustments to the white slider and the black slider.

Noise Reduction

Noise in pictures (although inaudible!) is unwanted variations in tone or color at the pixel level. In film photography, the analog was called "film grain". It becomes more objectionable as exposure decreases - usually because the user has chosen a high exposure ISO settings in the camera. It also affects areas that have dark tones in digital picture more than lighter areas.

All things being equal, digital cameras having sensors with larger effective light collection area per pixel are less likely to produce noise. Of course increasing the area of each pixel sensor reduces the megapixel count on a sensor - a tradeoff. Most small consumer cameras combine a small sensor with a high megapixel count, making them most susceptible to noise.

Noise also increases when making very long exposures in dim light. The culprit is photodiode leakage current and it produces a salt-and-pepper type of noise. Sometimes a technique known as "dark frame subtraction" can help with this type of noise.

More information about noise can be found online. A good overview can be found at Wikipedia.

Gray square, no noise
(all pixels the same color)
Gray square, noisy
(random variations in pixel colors)

TIP: When scanning prints, textured print surfaces (matte or "pearl" surfaces, or fake canvas, etc.) often produce speckles and other unwanted artifacts in the picture. These artifacts are a form of noise. If you have a choice, choose a glossy print surface to achieve the smoothest scan.

The old way to reduce noise in a photo or scan was Filter> Noise>Despeckle. Back in 2005, Photoshop CS2 introduced a new Reduce Noise filter. (Filter>Noise>Reduce Noise...) It was much more sophisticated than the older Despeckle filter, and gave the user greater control over noise reduction.

Choose Filter>Noise>Reduce Noise on the darker parts of the musicians.tif file. Be sure to magnify a part of the picture to examine by clicking the little "+" sign at the bottom of the filter's preview.

To maximize the noise reduction, increase Strength and decrease Preserve Details in the dialog box. Use a modest amount of Sharpen Details to recover some sharpness lost when noise is reduced.

TIP: The last-used filter will be inserted at the top of the Filter menu list. If chosen, it will apply the filter again with the last-used settings. If you want to use different settings, do not choose it. Instead, navigate to the original location of the filter and choose it there to be able to adjust settings.

Reducing Visible JPEG Artifacts

The Reduce Noise filter can also reduce jpeg artifacts in pictures...

Open venezia hit hard.jpg from Exercises 3.

Zoom in on the face to see blocky aggregates of pixels. These are jpeg artifacts from a #2 quality jpeg compression. Remember that saving as a jpeg actually changes a picture's information with the amount of change determined by the user. Because I chose a very low quality setting, the picture shows serious degradation.

Open the Reduce Noise filter and experiment with Remove JPEG Artifact check box in addition to the rest of the controls.

Magic Wand Selections
Use the Magic Wand + Shift key to add to a selection on the sky of the corn sellers.tif file - then used the cloud filter on the resulting selection to demonstrate how just the selected area is affected.

Open corn sellers.tif (Exercises 1) for in-class exercise.

Rotate the image. (Image>Image Rotation, 90 degrees CW).

Use Image>Adjustments>Levels to optimize the tones in the photograph. (Note how the histogram is "combed" with gaps between data -- this is a telltale sign of repeated image adjustments that slowly deteriorated the image with each iteration.)   

Convert to RGB color mode. (Image>Mode>RGB Color).

Choose the Magic Wand tool. Because this is a photo, make sure "Anti-alias" is checked on the Options bar.

Select the sky in the photograph using the Magic Wand tool. Use the shift key and click again with the Magic Wand tool to pick up other areas of the sky that weren't automatically selected the first time. If some of the trees in the background area selected, then use the Option key to subtract them from the sky selection. Further refinement can be done in the Magic Wand Options bar  -- try reducing the Tolerance to around 20 to select a narrower range of tone.

Once the sky is selected, choose a pale sky blue as the foreground color, white as the background color (TIP: hold the Command key to directly select a  background color from color swatches).

Make a fake blue sky with clouds by choosing Filter>Render>Clouds. It will create synthetic clouds using both the foreground color and the background color.

Try changing the foreground and background colors and use the filter again.

Quickly Leveling Horizons and Straightening Vertical Lines
Sometimes a camera isn't leveled when a picture is made. Tilted horizons result. Photoshop's Ruler Tool makes quick work of leveling a horizon or straightening a vertical line in a picture. The Ruler tool is grouped with the Eyedropper tool in the Toolbox . The icon for the tool is a small ruler.

Open the file named Beach.jpg in Exercises 1.

Choose the Ruler Tool (it may be nested under the Eyedropper tool in the Tools Palette) and drag a line matching the tilted horizon or vertical line you wish to straighten.

Then choose Image>Image Rotation>Arbitrary. The rotation angle necessary to correct the tilted horizon or vertical line will be entered automatically in the Arbitrary dialog box and you merely have to click OK to straighten the picture.

Crop to suite.

The Edit>Transform Menu
Transforms can stretch, rotate, and distort your image to fix image problems or for creative effect. In order to use the transformations in the menu (Scale, Rotate, Skew, Distort, Perspective, Warp, and more), you must first select all of the picture when you have a single layer. In multi-layer pictures, no selection is necessary when working on any background other than the Background.

Be careful when applying these transformations. They can distort the shape of objects within the picture. For example, using Scale to shrink a picture horizontally may "slenderize" people in an unnatural way.

Perspective adjustment
Even if you have a level horizon in a picture, the act of tilting a camera upwards or downwards will introduce perspective convergence into the picture. A common example occurs when you tilt a camera upwards to include the top of a tall building - the picture of the building has converging vertical lines and the building looks smaller at the top than the bottom.

In the past, view cameras or specialty architecture lenses were necessary to overcome this fundamental physical principal, but Photoshop makes such corrections available now for users of 35mm cameras using ordinary lenses.

Open fake building.tif for perspective changes.

Select>All

Edit>Transform>Distort - (it has the advantage of more adjustments than the one called Perspective) Once the vertical lines are parallel, double click inside the picture to apply the adjustments. Crop after the adjustments are made to remove the non-picture stuff that results.

NOTE: Vertical guidelines can be dragged from the left ruler to aid your assessment. Rulers must be turned-on to do this. (To display rulers, select View>Rulers (or type Command-R).

If the building has all the vertical lines parallel to each other but it is merely tilted, choose Select>All, then use the Edit>Transform>Rotate command. Click and drag on the corner handles to rotate the vertical lines upright. Double click inside the picture to apply the changes. Use this only if necessary.

With most perspective adjustments, making the vertical lines of the building appear straight-up-and-down is usually sufficient to have the picture appear normal to the eye. However, one pitfall for beginners is to accidentally stretch or squash the picture making it look like something viewed in a fun-house mirror. Keep you eye on known geometric shapes like circles and squares to aid adjustments. Making the top and bottom adjustments equal but opposite on each side helps maintain the proper proportions too.

IMPORTANT TIP: If the top and bottom adjustments are truly equal and opposite, then the midpoint square on the left and right edges of the Distort selection should still lie on the picture's edges.

To see what's possible, view an assembly of four smaller images corrected for perspective (and for uneven lighting) that was created for a textbook illustration. The file Perspective_assy.pdf available in Exercises 1 shows how several photographs are assembled into one image. The file is also available over the web. Perspective_assy.pdf (138k)

Back in 2005, Photoshop CS2 included a new Lens Correction filter (in CS5 it's found under Filter>Lens Correction) which can also be used to correct perspective problems and to make horizons level. I find its use to be a bit more complicated than Edit>Transform>Distort, although some of the other adjustments can be handy if there is barrel or pincushion distortion, chromatic aberration, or vignetting that needs to be corrected.

Content Aware Scaling
Photoshop CS4 added a new Content Aware Scale function (Edit>Content-Aware Scale) that will smartly shrink one dimension of your picture and attempt to keep it natural looking. It isn't magic, but with photos that have a plain or simple background, it is a great expedient.

Open 03 Golf Content Aware.psd (Exercises 6).

Choose Edit> Content-Aware Scale

(NOTE: If the picture you are working on has only one layer, you will have to Select>All first)

Slide the right edge marker to the left to make this horizontal picture fit a vertical magazine layout.

 

Technical Exercises 1: Place files in the Turn-in_01 folder  - Due April 13
1) Fix flaws in fade left.tif using the rubber stamp tool. Do not remove the lettering - just the squiggles.

2) Correct musicians.tif in Exercises 1 (tone, remove the lamp on the wall, crop)

3) Correct PerspectiveChapel.tif for tone and perspective. When correcting perspective, make sure that the vertical lines are vertical when done, and that you haven't accidentally "squashed" or stretched the picture when adjusting it. Don't try to adjust the horizontal perspective - it looks very odd if you do! A corrected thumbnail appears below to aid your adjustments.

When submitting files, be sure your LAST name is the first part of the filename so you get can get credit for your work. Continue this practice throughout the quarter. If you have a very common last name, please add your first initial to the end of your last name. -- i.e. "smithk_musicians.tif" or "jonesw_musicians.tif".

Don't submit your pictures together in folders! Let me repeat that....DO NOT put your files in a folder for submission. It wreaks havoc with the Macintosh server's permissions for files within a folder you make and I may not be able to manage the files within the folder.

Also, do NOT do a "Save" or a "Save As" from Photoshop directly into the turn-in folder. The file name only gets placed onto the server, but the contents (picture) will be missing - it's an empty,  zero k file without any data. Save to your desktop first, then drag-copy the file to the server.

 

   
Retouch out the squiggles found in the original, but leave the word "Pizzaz!"   Tone, crop, and rubber-stamp out the lamp on the wall behind the musicians.   Straighten the vertical lines that lean in the original, tone and crop.