Photoshop Tech

Quick image straightening with Photoshop

Microsoft Digital Image Suite, for all its limitations, does a few things really well:

  • Fix red-eye
  • Stitch together panoramas
  • Make straightening images brain-dead easy

I love Photoshop.  It’s definitely my image editor of choice but I always used to launch Digital Image to straighten pictures, then I’d go back to Photoshop for the rest of my tweaks.  It wasn’t until I bought The Photoshop Book for Digital Photographers by Scott Kelby (also in flavors for CS2 and CS3) that I learned the Photoshop method.

Straightening images is actually a pretty simple process, but nowhere in the Photoshop UI does it say “straighten”.  I suppose I could have read the manual, but where’s the fun in that?

The basic steps are:

  1. Use the measure tool to figure out the angle to rotate
  2. Perform an “arbitrary” rotation
  3. Crop your picture

Let’s say you’re in a hurry (or drunk) and snap a quick photo at a wonky angle.

The first step (after opening the picture with Photoshop, of course) is to select the measure tool from your tools palate.  The measure tool is the ruler buried under the eyedropper tool and can be accessed by clicking and holding or by hitting shift-i repeatedly until the measure tool is selected (I’m a big fan of keyboard shortcuts in Photoshop, they save me a bunch of time and make me feel like a power user).

Once you have your measure tool selected you need to pick a line in the picture you think should be horizontal or vertical.  If you’re straightening a landscape the horizon is a good bet.  If you are shooting buildings using a wide angle lens you’ll want to pick a line near the center of the picture and probably a vertical one.

Use the measure tool to draw along the line you think should be vertical.

Rotating the picture is now a fairly automatic process.  From the Image menu select Rotate Canvas -> Arbitrary.  When the dialog pops up you’ll note Photoshop has already filled in a number.  The software has looked at the line you drew using the measure tool and input the number of degrees to rotate automatically.  All you have to do is press OK.

Your image is now straight but you have some extra gunk you need to trim off.  Grab the crop tool from your palate (or hit “c” on your keyboard) and pick out the part of the picture you want to keep.  Hitting enter on your keyboard will crop the picture and after you save you’re done.



Quick and dirty white balance correction with Photoshop

If you’re shooting in RAW format you have the luxury of tweaking white balance as you open your images. This can allow you to adjust for camera inaccuracies or even for artistic effect. If, however, your image is a JPEG you’re not out of luck.

My old D100 still takes decent pictures but it certainly ain’t fast. If I shoot RAW it literally takes eight to ten seconds to write an image to memory. When trying to take rapid fire pictures of a running greyhound this doesn’t cut the mustard (though one could argue the merits of mustard cutting). Yesterday I was taking pictures of Finney romping in the snow and found the morning light plus snow combo had confused the heck out of my poor, senior citizen of a digi-cam. Everything came out with a blue wash. Fortunately my buddy Rob showed me this common and easy technique.

Pick an area that has both black and white areas (or areas that should be white) and zoom in. You’ll be using an eyedropper tool, so zooming in will allow you to pick the right spot more easily.

From Photoshop’s Image menu choose Adjustments > Levels. This will bring up the levels window with a histogram. First thing you’ll do is grab the little white tab on the right side of the histogram and start dragging it to the left.

As you drag you’ll see the image becomes more and more washed out. The goal is to emphasize the blackest of the areas on the picture. Once you’ve identified the blackest of the areas on your image you’ll use the Set The Black Point dropper (the black dropper from the levels window) to sample your new “black”. Once you take the sample the image will go back to looking more normal.

Next repeat the steps by grabbing the black slider to the right. This will darken the image to allow you to identify the whitest of the white areas in the image.

As with picking the black areas, you’ll need to play with the slider to get the right contrast, then use the dropper to pick the location you’d like to define as white. Once you use the dropper the image will once again snap back to “normal”. After picking the white level, however, the color issues should be largely fixed in your image. Here’s a before/after comparison of the picture with the as-shot on the left and the corrected on the right.

But hey, right next to the Levels menu item is an Auto Levels item. Why not just use that? Actually, there’s no reason not to try it out. It will often correct the color just about as well as this manual technique and take a fraction of the time. The auto levels correction, however, is not quite as accurate and I find the results from the manual method give me an image that looks much more the way I remember the scene in my mind’s eye. I do, however, often just blast through a bunch of pictures using auto level when I’m trying to speed through a big batch.

I owe two thanks to Rob for the above. 1. Thanks for showing me how to do this. 2. Thanks for taking such awesome pet pictures and inspiring me to point my camera at Finney and try to capture some of his personality.

If you live in the bay area and would like to get pictures taken of your pet, your first (and only) stop should be Murphy Dog Studios. Rob is a wonderfully talented photographer and he loves pets (his business is named after his late lab, Murphy). Don’t worry, if you don’t have a dog, or even a pet, Rob can shoot just about anything. Check out his amazing sports photography too.


You will buy an iPhone!

Reading Trina’s story of how she went out and bought an iPhone, a product she originally dismissed, got me thinking again about how much of a marketing and branding genius Steve Jobs really is.  Apple creates great products with slick interfaces and wonderful customer experience.  The key, however, is how their products are not just tools… they are fashion.  Jobs et al have a commanding grip on the minds of the young and hip.

And then I opened up Photoshop…


Quickie cartoon me

For a while now I’ve been wanting a caricature of myself.  Several friends have cool buddy icons for messenger or as a tile on their blog.  Two things stopped me though: 1. my artistic talent is mediocre at best and 2. I’m too cheap to hire someone to make one for me.

So, what’s a cheap hack to do?  Why, come up with a quickie technique to make my own picture, of course.

0. Basic training

Before we get started, here are a few tips and notes:

  • I use Photoshop – it’s what I have, it’s what I know.  If you’re a photographer or an artist and looking for a great program, I highly recommend it. Many other paint, however, will work just great for this.
  • Make lots of layers – anytime you think you’re doing something new, make a new layer, you’ll thank me later.  Besides… CTRL-e (CMD-e on Mac) will merge a layer down so there’s no downside.
  • If you don’t like the results, try a different picture.  You’ll be surprised at how quick this can be and trying again is no trouble at all.
  • Small is good – starting with a little picture (I used one which is 150px by 150px) means less detail to distract you.  A cartoon version of you shouldn’t have much detail, Snoopy didn’t have whiskers, did he?
  • I figure you know how to use your paint program, so I skip a lot of detail.  If you have questions, ask, I probably need to clarify these steps.

1. Pick a pic

First, I selected a picture of myself I like.

Reeves and Paula in Goshen

I recommend using a brightly lit picture, I’ve re-tried this technique on a few different pictures and found dark images are hard to work with.

2. Double your fun

The next step will take all the color out of the picture, and you’ll want that color, so make a new layer.

Layer -> Duplicate Layer

As you go along and create new layers I highly recommend naming them. Later, when you want to edit a specific layer, it will be easier.

3. Xerox it

After drawing my first cartoon me on paper I figured out where the hard lines for my face were… but there’s a shortcut.  Use the Photoshop “photocopy” filter, it’s under sketch.


For this picture I simply set the detail all the way down (1) and the darkness all the way up (50).  You should play with it on your picture to get some good lines.

4. Trace elements

The photocopy filter has now given you a set of lines to trace.  It has probably given you too many, in fact, so don’t get greedy.  Try to draw the minimum number of lines.

Make a new layer (don’t duplicate this time, make a clean, new layer).  I named this layer “face”.

Grab the brush tool and set the color to black and set the size.  You’ll want to get a size which feels kinda cartoony, you can play with it to see what you like.  Go thinner for less drama, go thicker for a more Scanner Darkly look.  As a starting point, go with about 2% of your image size (my picture was 150×150, I used a brush size of 3px).

5. The straight and narrow

The trick to make this fast and easy (and make it look kinda cool) is to not draw freehand.  Pick a place to start (the jaw, under the ear, is a good one) and put a dot.  Next, pick a place along the jaw, hold down the shift key, and click again.  Photoshop will draw a line between the dots.


Continue along the outside of your face, a couple clicks on the jaw, one on the chin, back up the jaw, around the ear and follow your hairline around.  Once you’ve done the full face shape, add the hair using the same technique.

6. Eyes and ears and mouth and nose

Once you’ve finished the shape of the head, move to the eyes.  You should be able to get the shape with 3 to 4 clicks.  Start at one corner then click a couple more times to get the other corner. Draw a small box for each pupil. For my eyes I didn’t need to draw the bottom, just the top.

If you’re smiling in the picture you’ll likely have some smile lines, add those in. 

Eyes and nose

A few quick lines under the nose is all that’s needed to highlight the bottom and then one line for the side of your nose.

7. Color by numbers

Hide the photocopy layer so you can see your original picture under your lines.  Create a new layer above the photocopy layer but under your drawing.  Triple your brush size (9px in my case) to give more coverage and sample the color from some place on your face using the eyedropper.

Color away!

Eyes and nose

Now you need to add a little depth.  Create a new layer on top of the coloring you just did.  You’ll need a darker tone of flesh than you used before, so click the color palate (if you drop the “B” in the HSB section by about 10, you should be golden).

On a new layer use the shift-click technique again to trace the outer edges of your face, along your smile lines, under your nose, along one side of your nose and over your eye lids.

Eyes and nose

Sample your hair color and fill it in (I used the magic wand to speed up this step).  Adding a second hair color will also help (hide your hair color, create a new layer and sample some highlights to paint in with a medium-sized brush… say 5px).

Eyes and nose

8. Mad props

If you have a hat you always wear or (like me) you wear glasses, add those in now.  For glasses I recommend a thin brush to draw the frames (on a new layer, of course) and then draw the shape of the lenses in a neutral gray (on yet another layer).  Put the lens layer behind your face layer so the eyes appear to be showing through the lenses.

Eyes and nose

9. That’s all folks!

Now all that remains is to be sure your original picture and photocopy layers are turned off and save your new cartoon you.

Eyes and nose