November 3 2006

How the hell do you make mathematically-correct curves in Photoshop?

For the uninitiated, drawing with paths can seem quite daunting. Certainly there is very little about the process that bears any resemblance to how one might draw with traditional drawing tools like, say, a pencil and a ruler. So, there are lots of tutorials out there on the web for how to use paths in vector-illustration packages like Illustrator, Freehand, Photoshop et al. But for the larger part these only deal with how to use the common aspects of the path tool; creating anchor points, editing control points and creating very simple primitives like circles.

All good and well, but generally speaking you won’t use vector illustration for creating simple primitives or abstract curvy shapes; after all, if you didn’t care about the precision of what you were drawing, you’d not be using paths in the first place. This appears to be the outer limit of what you can learn for yourself from tutorials online (at this point I should note that I’ve not read any print books which deal specifically with this kind of thing, so for individuals of that background I imagine you’d do better to invest in a decent book on Illustrator etcetera).

But why would you care about drawing things with any degree of precision? Well, I’ve touched on this before; essentially it’s about making things look as natural as possible. When drawing something which is an abstract representation of a real-world concept, then any obviously unintentional deviations from what you’d realistically expect of that real-world concept become rather conspicuous. A shelf that wasn’t quite straight would be visually jarring, and the same is true of drawn lines that aren’t correctly spaced.

Let’s consider stroke weight.

Helvetica Neue LT 97 Black Condensed vs Helvetica Neue LT 95 Black, horizontally squashed

Here for comparison is some text set in that designer’s old favourite, Helvetica. The top example is 97 Black Condensed, and the bottom is 95 Black, only horizontally squashed to the same width as the top. Note that they are not the same, however; compare the shape of circular devices such as the letter E, and most importantly, the stroke weight of the letter T. They’re not the same. Clearly you can’t just transform text like this and expect to get nice easy typographically correct results. The same is true with shapes:

a circle and an elipse

If you take a circle with a stroke width of 20px drawn with two concentric circles and stretch it to 150% horizontally, the stroke width doesn’t remain even. At the horizontal axis it’ll have a stroke width of 30px, whereas it’ll remain 20px vertically. This might actually be a desirable effect (it’s how a lot of serif typefaces’ uppercase letter O are drawn), but for certain types of drawing it isn’t.

A close-up of the London Underground tube map

This is a zoomed-in section from the London Underground map. Notice how the lines have subtle curves for the inflection points. Also note that the circumference of the outside curve is greater than the inside. You can’t create this effect by simply duplicating the same curve and translating it by your stroke width:

A badly-weighted stroke

Now, all of this is pretty much moot if you’re using a package that supports outline strokes (like Illustrator), as you can have it handle all this for you. But in Photoshop? That’s another matter entirely. Consider Apple’s iconic ‘shuffle’ symbol, used both within iTunes as the icon representing shuffle mode, and effectively used as the ‘branding’ for the iPod shuffle:

Shuffle icon

Here we have two arrows featuring the same curved-bend inflection seen on the tube map. If we wanted to have a similar style of line in Photoshop, it’s clearly going to require some work to create it from primitives. Let’s start with a ring.

Drawing curves: step 1

We’re going to want to cut away most of that ring, since we’re only interested in having an arc of a given angle. The exact amount of arc we need is determined by the angle of the section of the line that crosses the other arrow-line. Apple used roughly 52°, so we’ll do the same; first though, let’s just cut it down to a quarter-arc.

Drawing curves: step 2

So, we only want a 52 degree arc. The easiest way to remove all of the excess is to rotate the arc through -52° around the origin of the initial circle, and then cut away the bit that lies above the horizontal axis, like so:

Drawing curves: step 3

We then have the linking section of the line, which we can assemble into something useful with additional rectangle primitives (note that you may have to do some minor nudging of the paths to ensure they marry up precisely, otherwise you may get faint gaps in between them which would be visible at high resolutions).

Drawing curves: step 4

From there you can take it in whatever direction you need to accomplish your intended effect. Of course this is all massively unwieldy and you’d be far better off attempting it in a tool designed for the job, but not everybody can afford a copy of both Photoshop and Illustrator, so this technique has some purpose when this tool isn’t available.

Anyhow, here’s my end result.

Final resulting Shuffle logo drawn with curves