Part 5

Straightening & Scripting

This is the fourth installment of Paper to Pixel to Paper Again, a series that explains (in an overly thorough manner) the how-to's of preparing artwork of all stripes for print.

We have only been able to put this together because of the support of our patrons, both subscribers on Patreon, and by one-time donators to our Living the Line Paypal account. Thank you so much for your support! We couldn't do it without your generosity.

If you haven't done so yet, please go back and read the previous installments.

Last week, in the midst of making a script to adjust our original art scans, we left off right before we got to the good stuff: how to apply sharpening to our image in order to wring every last detail from the image.

But first:

What Is Sharpening?

First off, let me acknowledge my debt to Bruce Frasier and Jeff Schewe, the authors of 2009's Real World Image Sharpening, a fine introduction to the world of image sharpening. Though that book is focused almost exclusively on working with continuous-tone image (i.e. grayscale or color rather than line art), it's still an excellent primer and overview of what sharpening is, how it works, and how to manipulate the various tools to get the results you want.

And although Bruce and Jeff will recommend a bewildering array of methods and tools for your sharpening needs, I find that I can accomplish everything I need to do with one simple tool. But, really, if you're a graphics professional who's never sharpened anything in your life, find a copy of the book and read it two or three times.

So! What is sharpening?

Whether you're scanning a flat document with a flatbed scanner or shooting an image in the real world with a lens and a sensor, every single stage imparts some kind of softness to the image. There is no perfectly sharp optical system. Lenses and sensors have physical limitations that causes fine details to blur. Digital cameras have anti-aliasing filters (intended to prevent moire resulting from undersampling of high-frequency information) that unintentionally soften fine details of an image. The image space you're capturing in might not be fine enough to capture all of the detail, which results in these finest details soft and lighter than they would appear under magnification. All of these considerations create a softer image, and these are only our first-stage concerns! Printing brings its own softening to an image.

Sharpening is our tool to combat this seemingly-inevitable softening of detail.

For all of our sharpening needs, we'll be using the oldest and simplest (and most computationally-efficient!) sharpening tool available—Unsharp Mask.

You might wonder—unsharp mask? why the funky name? Well, this process actually has its roots in an analogue darkroom process, by which the dark room technician would make a blurry duplicate of the negative, offset it from the original, and then combine the result. And that's, technically, what's happening behind the scenes as well when you're using the digital version of this tool.

If you're the type of person who finds the above paragraph interesting, then I refer you again to Real World Image Sharpening. If you're the type of person who's banging your desk and currently shouting "GET ON WITH IT" to your computer screen, well, sorry! Have a ginger ale and skip down a bit. I'll get there.

We Continue Our Script

Hey, just kidding! We've arrived at our destination! (How was the ginger ale?)

Open up our document we're adjusting again and zoom way in on an area of dense hatching and/or tiny tone. Now remember last week we added a Threshold adjustment layer so we can preview what our image will look like as a 1-bit bitmap, and compare it in real time to the continuous-tone (grayscale) version of our image. Now that you're zoomed in, go ahead and click the Threshold adjustment layer on and off. You'll notice that, if your hatching is dense and fine enough, some of the areas of white fill in a bit (or even entirely) as you click on the Threshold. This is due to the softness inherent in your optical capture of the image, and this fill-in would be the same if the image had been shot on a stat camera (or possibly worse, depending on your scanner, and the quality of the imaging on the stat camera).

Left: Zoomed in WAAAAAY too close to some really dense hatching, with the Threshold layer turned OFF.

Right: Zoomed in WAAAAAY too close to some really dense hatching, with the Threshold layer turned ON! Notice we have some fill-in happening, both in the finest areas and just a teeny bit in the more open areas as well. (Though this effect can be visually misleading in an upsampled file—don't expect a 1 to 1 correspondence between the visual grayscale image and the line art result. If you're unsure, see last week's note about using Nearest Neighbor to compare an upsampled file to an unscaled one) This is due to the softness of the scan, which the sharpening will correct.

Okay, now turn off the Threshold adjustment layer again and, making sure your Sharpened layer copy is selected and your Action is turned back on, go to Filter -> Sharpen -> Unsharp Mask.

And here it is, the Command window that we'll see more than anything other than Levels or Curves.

A quick breakdown on what does what—

AMOUNT is the intensity of the effect being applied. In this case, it's best to start with this set to 500%, not because you'll EVER use it there, but because it'll help you judge what's happening better.

RADIUS is the width of the sharpening effect. If this is set too high, your fine-line information will magically become thick-line information, and the same for your dense areas of hatching. If this is set too low, the effect will be minimal, and might only contribute noise to your image. If you have a very good scan and it's been only minimally (up to 250 percent) upscaled, then the Radius should probably be set somewhere near 1 pixel. Let's start it there for this application, and work it up if we need to.

THRESHOLD is how deep the effect goes. How contrast-y does an area have to be for contrast to be applied? If you have the Threshold set too low, then Unsharp Mask will pick holes in your black areas and make noise like unerased pencil lines or smudges or dirt or... whatever... more prominent. If you have the Threshold set too high, then you'll only be affecting the areas of your image that are already the most contrast-y, defeating the purpose of the sharpening in the first place.

Okay, so I've set my Amount to maximum (500%) and my Radius looks good at 1.1 pixels and Threshold at 20 or so. I can see my details firming up, my fine hatching opening up, and scooting across and checking the rest of the image, I can see my finest lines firming up as well. Once I have the other settings, I back my Amount down to a more reasonable (and less crispy-looking) 200 percent or so, and hit Okay.

Now, I'm going to take a look at different parts of my image and see what I've done, by turning on my Threshold Adjustment layer again and clicking the Sharpened layer on and off, so we can directly compare the sharpened and unsharpened image. I see that lots more of my detail has been retained, both fine line and dense hatching, including some unintentional "details" that I'll have to clean up later (like the razor blade cuts where Gerhard used and exacto knife to trim the mechanical tone!) But it's looking pretty good overall.

But we can improve it just a bit more.

Now that we've done our first round of sharpening, I'm going to knock out the remainder of our paper color by making another Levels adjustment. Hit Ctrl-Alt-L to bring up the Levels command.

In my case, I'm going to leave my Black Point and Mids Point/Gamma Control exactly where they are and only move my White point just a bit to the left, knocking out a bit more of the "color." This will enable us to retain detail within/underneath the tone as well, which is after all just a bit softer and filled-in because of the softening presented by the carrier film of the tone. (if your tone is yellowed and aged, then this is even more critical). Just a little bit will do.

After this, depending on the softness of your scan, you might require one more blast of sharpening, possibly with a different radius than the first. As always, compare your results as you go, and play a little conservatively with this, keeping in mind we're making a script to be appropriate to every page scanned from original art!

In my case, the page looks pretty good here, so I'm going to stop my script and call it good, knowing that I might choose to sharpen a bit more on some areas of some pages in my cleanup stage.

So, how did we do?

Top: No upscaling, no sharpening, just 1-bit conversion.

Middle: Upscaling to a 2400 ppi space and then 1-bit bitmap conversion. No sharpening.

Bottom: Upscaled, sharpened, and then 1-bit bitmap converted. Notice the bits of unintentional "detail" that have been brought up with the intentional. The softer your scan, the more dramatic the difference sharpening can make.

Now that you have a "first draft" of your Action, it's time to test it on other pages, ideally pages that have a sampling of different techniques. Run the Action on these pages and take some notes. Is your routine bringing up too much noise? Play around with your Threshold on your sharpening, or lessen the Amount, or make your initial Levels adjustments so that the page is a bit blacker overall. Are the pages still too soft? Try adding another Sharpening layer. Each change you make to the script will alter the later stages, so sometimes it's easier to start from scratch rather than to tweak what you've already made.

It's DEFINITELY worth your time to get this part right! Take your time tweaking this until it looks pretty damn good on every page you try. If testing the script is taking too long, try cropping the test pages to only a portion of the page so running the script is faster. Do a lot of iterations. Figure out what will work best for YOUR scanning setup, YOUR needs. And PLAY WITH UNSHARP MASK until the controls are second nature! There are CRAZY things you can do with this very simple tool (often in conjunction with Gaussian Blur). Play with them until you learn what they are!

The point of scripting is to save you time overall, not make extra work for yourself, which is what you're doing if you're writing a script that's not really doing its job.

Side Bar: Hey, Man, Does This Sharpening Stuff Really Work? Like, Really?

Good question!

Here's a tiny detail from a Minds page, presented both in grayscale and bitmap-converted.

Now I'm going to simulate a slightly out of focus, blurry scan, by applying a Gaussian blur to the entire image, with a 2.6 pixel radius.

Here's what that blurry image looks like, both grayscale and bitmap-converted.

Notice how the bitmap image has lost most of the fine lines, and the tapered edges of the less fine lines. So let's sharpen it with the exact routine described above, using Unsharp Mask, a radius around 1 pixel and a low Threshold, and then knocking some "color" back with Levels, then sharpening again with the same settings.

Here's the result.

Now that there is some wizardry. Or, ah, the power of mathematics applied to visual imaging. Take your pick.

Now it's time to run our action!

With no files open, go to File-> Scripts -> Image Processor.

This is definitely the easiest Photoshop dialogue for batch processing of this type (not the aptly-named "Batch" function, which is useful for other purposes, but more cumbersome for this). Select the target folder for processing, and set a destination folder. I make a separate destination folder called "[Name of book and type of file] Cleaned", and have all the processed originals go there, saved in PSD (Photoshop) format. And at the bottom of the dialogue you can select your Action for running.

Now hit Run, and let that puppy go! Photoshop will soon start flashing with small slices of images that it's opening, processing, and closing. This process might take a while.

It's worth noting though that it will take significantly LESS time than if you were opening each file, running the script, then saving. This is because every process is more efficient if your computer isn't compelled to perform any normal display functions—it can operate in a much more processor-efficient manner while batch processing like this.

When it's done, you might have a few files remaining open that didn't get saved. If this happens, this is most likely because they're too large to be saved as PSD files and need to be saved as PSB files (large document Photoshop format) instead. Go ahead and do so by hand for any remaining open images.

And now, assuming everything went well, we can at long last...

Next: Clean Some Originals