User:Jhellingman/Image processing work-flow

From DPWiki
Jump to navigation Jump to search

The following series of screenshots describes how I process scanned gray scale images in Photoshop.

The image I start with is taken from the Dutch version of an old Jules Verne novel. As you can see, the image is slightly rotated, and some paper texture is visible.

I normally scan at the highest optical resolution the scanner allows for, at 16 bits per pixel, and with all automatic enhancements (levels, sharpening, etc.) turned off. Although this image is in black-and-white, my current practice is also to scan in full color, 16 bits per channel.

The initial image as loaded in Photoshop.

Crop and Rotate

When not scanned at 16 bits (mostly the case for scans harvested from scan archives), the first step is to switch from 8 bits per channel to 16 bits per channel, using the option under the Image | Mode menu.

Then I crop and rotate the scanned with the crop tool.

Image Cropped and rotated.

Adjust Levels

After cropping, I go to Image | Adjust | Levels... to adjust the levels. I typically make the darkest grade of gray black with the slider on the left, and remove most of the paper texture visible with the slider on the right. Here it is a matter of judgement and trade-off of how much of the paper texture you want to make white, and how much you want to keep. To much, and you loose fine details, to little, and you have a lot of work manually cleaning-up later on.

Adjust levels dialog.

The result of this step is shown here. You can still notice some remaining paper texture and dust on the image.

Image with levels adjusted.

Removing Specks

The next step is the removal of remaining paper texture and dirt that has accidentally been scanned.

First, we use the magic wand tool in the toolbar to select all 'near white' pixels in the image. Make sure the settings are similar to the ones I use in the image below (Tolerance 16 levels, anti-aliased, not contiguous), and click one in a white area of the image (You can make a small part of the image white beforehand).

Image with 'near white' pixels selected.

Then, we contract the selection using the Select | Modify | Contract menu. This means that we remove the border of the selected white away from the actual image. I typical use a value of 2 pixels.

Contract selection dialog.

After doing so, we will see a number of specks jump out in what is supposed to be the white areas of the image.

Partial image with selected 'near white' pixels.

We can now use the lasso tool (make sure to press the shift key) to add those specks to the selection. The result image will look like the one below. You can press the control key to remove parts from the selection.

Partial image with remaining specks removed.

We now give the selection soft edges, using the Select | Feather menu. We do this to avoid hard (and thus visible) edges in the image. Typically, I use a value of 2 pixels here.

Feather selection dialog.

The final step of cleaning the white background is to press the delete key, to make all selected 'near white' pixels really white.

Partial image after making selection white.

Image after making selection white.

I save the image in the original resolution as master image now.

Saving for Web

After cleaning the image we have to save it for web, as the image to be in-lined in the HTML version of an ebook.

First, we resize to a size suitable for use on a screen. I typically reduce the image to 144 DPI. If this leads to one of the edges being more than 720 pixels long, I will reduce the longest edge to 720 pixels. (For my more recent submissions, I double those values: 288 DPI, longest edge 1440 pixels, and then reduce them to half size in HTML. This allows readers to see the images in more detail and gives them a more crisp appearance on high-resolution displays.)

Resize image dialog.

I then re-apply the levels command, to make the darkest gray about 95% black.

Unsharp mask dialog.

Finally, I use 'unsharp mask' to give the image a more crispy appearance. Then I use the save to web feature to save the image as compact as possible. For simple black and white drawings, I normally use the PNG format (with 8 levels of gray, more if needed). For most other images, JPEG gives better results.

The final result.