|
Pete
Bauer on Photoshop
Resampling: Choosing between Bicubic, Nearest Neighbor and Bilinear
Now,
how about something useful? Recently, when discussing resizing images
in Photoshop, I found myself using the dirtiest word in the book:
"Never." Minutes later, I used the second dirties word:
"Always." Thankfully, after washing my mouth out with
common sense, I was able to correct myself. No serious injuries
resulted.
I had
told a group of students that they should avoid using Nearest Neighbor
or Bilinear when selecting a Resampling method, and that they should
always use Bicubic. In most cases, I'll concede graciously, I would
be right. "Most" cases. But not all. Let's think about
GIF files with limited color palettes and sharp delineation between
colors. Let me show you what I mean.

The
original image was 50 pixels by 50 pixels, with a simple H on a
colored background. The font is Arial Black, the anti-aliasing is
Smooth. Both the letter and the background were Web-safe colors.
I enlarged the image to 750 pixels, using each of the three Resampling
algorithms, and took each into Save for Web.

As
you can see, the Bicubic resampling produced a halo, the Bilinear
got fuzzy, and the Nearest Neighbor stayed true to the original,
including the visible anti-aliasing. For the record, both Bicubic
and Bilinear had lost some colors to reach the GIF-mandated maximum
of 256. The Nearest neighbor retained all of its original five colors.
The Bicubic file was over 50 KB, the Bilinear was a bit under 23
KB, and the Nearest Neighbor file was a little over 7.3 KB -- one-seventh
the size of the Bicubic file. The next step was to reduce the Color
Tables to Web-safe colors.

Reducing
the Color Table substantially improved the first two images, and
had little effect on the third. (Although what you see in your browser's
window may not completely agree.) The Bicubic image dropped to six
colors and just under 8.5 KB. Bilinear fell to just over 8.5 KB
and had five colors. Nearest Neighbor lost one color and the file
size shrunk insignificantly to under 7.3 KB. The last step was to
sharpen the images, though not with a filter. To make those edges
crispy-clean, I reduced each file to just the original two colors.

The
final image (below) shows detail of the color reduction results.
As could be expected, the three images are almost identical in size,
at just a hair over 4 KB. Both the Bicubic and Bilinear images had
irregular corners. The Nearest Neighbor image was crisper than the
original.

Not
too often do we find a need to blow up the letter H by a gazillion
percent, but when enlarging images that have sudden and sharp color
contrasts, consider using Nearest Neighbor as your resampling method.
This is especially true with horizontal and vertical lines or shapes,
such as those often found in Web buttons and banners.
As
a final note, when creating composite images such as those shown
above, remember that you cannot copy a layer from one image to another
if either is in Indexed Color mode. No matter how tired you are
or how many times you try. Really.
|