The PNG Guide is an eBook based on Greg Roelofs' book, originally published by O'Reilly.



Photoshop 4

Photoshop 4 is still in wide use and has a slightly different feature set from version 5, so we'll look at it in some detail, too. It supports the same basic PNG feature set the newer version does: colormapped, grayscale, RGB, and RGBA PNGs at sample depths of 8 bits or less, optionally interlaced, with no palette transparency or text support. Like PS5, it too has a gamma-related quirk, though not as severe. I'll discuss it in a moment.

Photoshop 4's support for PNG alpha channels is sufficiently well hidden that Jordan Mendelson set up a web page describing the step-by-step procedure for creating one, http://jordy.wserv.com/experiments/png.html. The approach is very similar to that in Photoshop 5, with the exception of the steps needed to actually modify the alpha channel for a portrait-style mask:

  1. In the Channels palette, click on the arrow at the upper right and select New Channel..., which pops up a dialog box.

  2. In the Name: entry field, give the new channel a name (for example, Alpha) and click the OK button; the other fields affect only how the alpha channel is displayed, not the actual image data, and can be left with their default values.

  3. In the Channels palette again, leave the alpha channel as the selected one, but make the original RGB or grayscale channel visible by clicking on the small box to its left (an eyeball icon will appear in the box). The main image will now be visible under a 50% red ``haze'' that represents the alpha channel, assuming the default options in the previous step's dialog box were left unchanged.

  4. Double-click on the Lasso tool (left side of tool palette, second from top).

  5. In the Lasso Options tab of the tool palette, set the Feather radius to some value, perhaps 13.

  6. Draw a loop around the face of the subject, but do not invert the selection.

  7. Erase everything outside the loop via EditClear; a soft-edged hole will appear in the red overlay, indicating that everything but the face of the subject is masked out.

Once the alpha channel is created, the whole image may be saved as a 16-bit gray+alpha or 32-bit RGBA PNG just as in Photoshop 5:

  1. Choose FileSave a Copy..., which pops up the usual file dialog box.

  2. Pick an appropriate directory and filename for the image, choose PNG as the format, and make certain the Don't include alpha channels checkbox is not checked.

  3. Click the OK button, which triggers yet another dialog box.

  4. Optionally create an interlaced PNG by selecting Adam7 as the interlacing type, and make sure the filter type is Adaptive for grayscale or truecolor images.

  5. Click the OK button.

If transparency is desired only as an aid in creating the image, not as part of the actual file data, go to the Layer menu and select Flatten Image before saving.

Gamma and color-correction information is always saved with PNG images, but in order for it to be meaningful (that is, not wrong), the monitor settings must be entered correctly in the Monitor Setup box, accessed via FileColor SettingsMonitor Setup (shown in Figure 4-3).

Figure 4-3

Figure 4-3: Photoshop 4 Monitor Setup window.

The information can either be entered explicitly, by providing values for the display system's ``gamma'' value, white point, and phosphor types (see Chapter 10, "Gamma Correction and Precision Color" for a more detailed explanation of these terms), or it can be done implicitly, by selecting a monitor type from a list of calibrated models. The implicit approach may not work exactly as intended, however; the default gamma value seems to be 1.8, whereas almost all PC display systems are closer to 2.2. Either way, there is one more setting, and this is where the caveat I mentioned earlier comes in. For the Ambient Light setting, only the Medium value will cause Photoshop to save correct gamma information in the PNG file. The High setting will result in a PNG gamma value that is too small by a factor of two,[26] while the Low setting results in a value that is 50% too large. Of course, this is still preferable to the case with Photoshop 5.0; at least Photoshop 4.0 has one setting that works correctly.

[26] Adobe's definition of ``high'' ambient light appears to involve something on the order of a spotlight shining in the user's face.

In other respects, Photoshop 4 is no different from version 5. It lacks support for text annotations, 16-bit samples, low-bit-depth samples and palette transparency, and its compression settings and interface are identical--that is, mediocre at best.




Last Update: 2010-Nov-26