Friday, December 26, 2008

Look Sharp!

Every once in awhile I come across images on the Web that look unusually crisp and sharp. But not in a bad way with obvious halos and other over-sharpening artifacts in images almost as common as those that look too soft. After tinkering with a few approaches, I've settled on a method that works well for me.

For a long time, I've been a big fan of PixelGenius's PhotoKit Sharpener, a suite of Photoshop tools for image sharpening based on the seminal work of Bruce Fraser and other authorities. Although I still use it exclusively for all sharpening aspects in my printing workflow, I've sometimes been less enamored of the results for Web sharpening.

Until recently, I used PhotoKit Sharpener to do capture sharpening and then used Photoshop's bicubic sharper algorithm for resizing down to Web territory. I've been relatively pleased with the results but looked around for a little extra boost.

After reading up on clinical comparisons of resampling algorithms (of which there are many more than offered in Photoshop), it seemed like there was a relative consensus that Lanczos, Sinc, and Catrom algorithms tended to do a better job than some of the others, including Photoshop's bicubic family.

I decided to try using the ImageMagick convert command to resize using the Lanczos filter. It's a command-line tool (which automatically turns many people off) with a huge and daunting set of often sparsely-documented options. But, after some Web research, here's what I ended up coming up with as my own starting point for down-sizing images for Web use:

convert -filter Lanczos -resize "500x500>" -density 96x96 \
-quality 80 -sampling-factor 1x1 -unsharp 0.6x0.6+1+.05 \
input_file_name output_file_name

This combination of command line options does the following:

-filter Lanczos
obviously selects the Lanczos resampling method from the many that ImageMagick supports.

-resize "500x500>"
indicates we want the down-sized image to be 500 pixels on the longest dimension. The ">" character indicates that we don't want to create a new image if the existing one is already that size or smaller.

-density 96x96
is just bookkeeping to indicate the image has a resolution of 96 ppi. It's not really necessary.

-quality 80
indicates the JPEG compression quality I want.

-sampling-factor 1x1
indicates the sampling factor for the JPEG compression. I don't know for sure, but this may be the default.

-unsharp 0.6x0.6+1+0.5
applies a little unsharp filter after the down-sizing. This is one of the most difficult areas to find useful information and guidelines on but this is what I came up with for 96 ppi display and it works well in most cases for me.

When I prep an image for Web use, I do the bulk of the work in Photoshop, convert to the sRGB color space (boo! hiss!) and save it as a TIFF file. Then I apply the convert command just described to create my Web-sized image. I actually have this command, and a couple others to handle IPTC copyrighting, etc., in a batch file that I just pass the TIFF file name to for processing.

Not every image will work optimally with this particular process but it's looking like a great starting point for my taste. Give it a try if you have ImageMagick installed. (It's available on all major platforms.)