Section 109. Change Color Mode

109. Change Color Mode

BEFORE YOU BEGIN

Just jump right in.


SEE ALSO

77 Convert Between Image Formats

78 Change Photo Resolution and Size

106 About Size and Resolution


One of the key factors affecting the size of an image file is the maximum number of colors it can include. If a file is theoretically capable of including a large number of colorseven though it may actually contain very fewthe file's size will be large to ensure that capacity. If you're working on an image to be shared over the Internet, small file size is often a high priority. One way you can reduce a file's size is to change its color mode the number of colors an image can contain, even if it doesn't actually contain that many. However, reducing the number of colors an image can use might lead to striation and patchiness in areas you think should be a single, solid color.

A full-color image in RGB color mode generally does not actually contain all 16 million-plus colors that standard video cards support. (For RGB color mode, each color channelRed, Green, and Bluemust be capable of "counting" to 256 for each pixel. 256x256x256=16,777,216.) To reduce the file size in a color image, the Editor gives you the option of switching to an Indexed color mode similar to the encoding scheme for GIF images. With an Indexed color mode, the entire image uses only 256 colors, although these colors are selected from all the 16,777,216 hues the standard video card produces. If your image is black and white, or black and white plus gray, there are other modes you can use to make your image file even smaller. How perceptible the difference is, when changing to a lower color mode, depends on the image you're working with. For this reason, the Editor makes it possible for you to sample different color reduction modes, enabling you to choose the least detrimental mode for your image.

NOTE

Because some commands are available only for images that use RGB or grayscale mode, you might sometimes find yourself temporarily increasing an image's color mode (from grayscale to RGB, for example). This won't, however, improve the resolution or quality of a low-resolution imageincreasing an image's color palette simply makes more colors available for use; it does not tell the Editor where to use them in an image to boost detail and clarity.


109. Change Color Mode


If file size is your main priority, you can compress an image into GIF, JPEG, or PNG format (for example), a process that also reduces its color palette a bit more scientifically than the method discussed here. You can also convert an image to grayscale to reduce its color palette.

1.
Choose Image, Mode

In the Editor, open the image you want to convert, and save it in Photoshop ( *.psd ) format. Choose Image, Mode from the menu bar. Select the color mode you want to convert to from the submenu that appears:

  • Bitmap 1-bit color in black and white; suitable for images in black and white only, with no gray tones.

  • Grayscale 8-bit color in 256 shades of gray.

  • Indexed Color 8 bits per pixel, in 256 colors, selected from the entire color gamut . Perfect for use with GIF images.

  • RGB 24-bit color, with 8 bits per color channel. Here, 24 bits are used to encode the color value for each pixel. Compare to Indexed Color , which uses 8 bits per pixel, and you'll understand why RGB images provide the most detail.

NOTE

Technically speaking, the number of bits (binary digits) required for an image to encode the color value for one pixel is the base-2 logarithm of the maximum number of colors. In other words, 2 raised to that power equals the maximum number. It takes 8 bits to encode up to 256 values, and 24 bits to encode up to 16,777,216 valuesthus the arithmetic behind the phrase 24-bit color .

If you're increasing color depth, the image itself is not changed, but more colors become available for your use. If you're reducing color depth, a dialog box appears from which you must choose options. Continue to step 2, 3, or 4.

2.
If Indexing Colors, Choose Options and Click OK

If you're reducing colors in an image with Indexed Color mode, select how you want the Editor to choose the colors for the palette by choosing from various options in the dialog box that appears. Before you begin making selections, enable the Preview option so that you can see how your selections affect the actual image. From the Palette list, choose one of the following options:

NOTE

If the image already uses 256 colors or fewer, the Palette option is automatically set to Exact , which means that all colors in the image are added to the palette. You do not have to make a selection.

  • System (Mac OS) uses the 256 color palette developed for the first color Macintosh computers. Select this palette to generate small files best displayed on Macs.

  • System (Windows) uses the 256 color palette developed for Windows 3.0, which has been used as the backup palette for 8-bit color mode ever since.

  • Web uses a 216 color palette (the last 40 index values are reserved) recommended for use in generating images for web pages because these are the 216 values that Mac and Windows have in common. Choosing this option ensures that the image will appear the same on both a Windows and a Mac computer.

  • Uniform calculates 216 colors from equidistant positions in the RGB color gamut by rotating color index values from all white to all black. This setting ensures that your image uses colors sampled from throughout the image's color spectrum.

  • The three Local options direct the Editor to create a palette based solely on the colors found in the currently open image.

  • The three Master options instruct the Editor to create a palette based on the colors found in all the images currently open in the Editor.

    Among the Local and Master options, Adaptive instructs the Editor to select 256 colors that are mathematically most similar to the colors in the original image.

    Perceptual takes the 256 colors generated by the Adaptive algorithm and alters the selections slightly to favor colors that the human eye would tend to notice if they were changedtypically throwing away more colors in areas with the least amount of contrast, while favoring colors in areas with high contrast because the eye would notice that more.

    Selective takes the 256 colors refined by the Perceptual algorithm and then weights the values to more closely resemble the Web spectrum, while also favoring broad areas of color within the image.

  • Select Custom to make changes to any colors in the palette that the Editor is currently preparing to adopt. When the Color Table dialog box appears (which looks similar to the Forced Colors dialog box shown here), double-click the color in the palette you want to change. Select a new color from the Color Picker dialog box and click OK . To add a color to the palette, click an empty spot and then select a color to add. Repeat for any other palette colors you want to change or add, and click OK when finished. You're returned to the Indexed Color dialog box.

  • Choose Previous to load the previously used custom color palette. Use Previous to convert a series of images to Indexed color mode, using the same color palette.

After selecting a Palette option in the Indexed Color dialog box, you can set additional options as well. To reduce your file size even further, set Colors to a value lower than 256 (to reduce file size significantly , select a value lower than 128).

The options in the Forced list instruct the Editor to override some or all of its palette color choices and to include specific color values, some of which you can choose yourself from the Forced Color dialog box that appears. These "forced" choices may or may not be represented in the actual image, but they are included in the image's palette:

  • Black & White forces the Editor to include pure black and pure white as two of the colors in the palette.

  • Primaries forces the Editor to include the first eight colors of the old IBM Extended Graphics palette: red, green, blue, cyan, magenta , yellow, black, and white. This allows a large measure of downward compatibility (if you really need it) with some of the first images ever produced for display on PCs.

  • Web forces the Editor to include the entire 216-color web palette ( essentially the same as choosing Web from the Palette list).

  • Choose Custom to change or add colors to the palette. Double-click a palette color. Select a new color from the Color Picker dialog box and click OK . To add a color, click an empty spot, select a color, and click OK . Repeat for any other palette colors you want to add or change and click OK when finished.

If the image has transparency but you don't want to retain it, disable the Transparency option. Then select from the Matte drop-down list a color to change the transparent pixels to. Semitransparent pixels are blended with the color you choose to make them fully opaque . You can choose Foreground Color, Background Color, White, Black, 50% Gray, or Netscape Gray (a lighter gray) from the list, or select your own color by choosing Custom from the Matte drop-down list and using the Color Picker that appears to select a color to use. To choose a color from the image, just click in the image with the Eyedropper tool. If you choose None from the Matte drop-down list, semitransparent pixels are simply changed to fully opaque ones and are not blended with anything. Transparent pixels are made white.

If the image contains transparent pixels and you want to retain them, enable the Transparency option. If the image contains semitransparent pixels, open the Matte list and choose a color to blend with them to make them fully opaque.

To reduce the side effects caused by using a smaller number of colors than the original image contained, select the dither pattern you prefer from the Dither list:

  • Diffusion instructs the Editor to apply an error diffusion algorithm, which blends dissimilar colors by dividing the differences between them mathematically and spreading that difference to neighboring pixels, hiding the transition. When you make this choice, enter the relative percentage of error diffusion in the Amount text box. Enable the Preserve Exact Colors option to instruct the Editor not to dither any colors it encounters in the original image whose values exactly match any of those in the current reduction palette.

    KEY TERM

    Error diffusion Any of several mathematical techniques that attempt to compensate for large error values (differences between the intensities of an original pixel and its replacement in a reprocessed image) by dividing this difference into parts and distributing it to neighboring pixels, thus masking the obvious inaccuracy.

  • Pattern applies a geometric dithering pattern, which might be noticeable in photographic images but is permissible in more patterned images such as original drawings.

  • Noise scatters dithered pixels randomly .

  • None turns off diffusion and causes the Editor to substitute the closest color in the palette for any color not in the palette.

NOTE

Because it uses a mathematical formula, error diffusion (when used in images with a very limited color palette or large blocks of color, such as comics art) can sometimes generate artifacts in a color-blended area, more so than using an ordered dither method such as Pattern .

To finalize your choices, click OK .

3.
If Converting to Grayscale, Click OK

When you're converting a color image to various hues of gray (grayscale), click OK ; if the image has multiple layers, you'll be asked whether you want to flatten all layers before proceeding. Click Merge .

NOTE

If the color layers currently in the image use blend modes other than Normal to create its current appearanceespecially if that appearance depends on how the color of one layer interacts with the colors of the layers beneath itthese effects will probably be completely lost if the image is flattened while converting it to grayscale. To preserve the layers and their blend modes, click Don't Merge in step 3.

4.
If Converting to Bitmap, Choose Options and Click OK

When converting an image to pure black-and-white ( Bitmap mode), the Editor could simply make relatively dark pixels black and the relatively light ones white. However, the result might not be desirable, so you might want to apply dithering.

First, let the Editor convert your image to grayscale by clicking OK . It's easier for the Editor to convert grays to black-and-white than to convert colors directly to black and white. If there are multiple layers, the Editor warns you to flatten them first; click OK to have it do that and continue. In the Bitmap dialog box that appears, in the Resolution area, make sure that your image is set for the resolution of your output device. At first, this is set to the image's current resolution. To ensure best appearance, you might have to adjust resolutionand thus, sizeaccordingly. For onscreen use, choose 72ppi; for printing, choose 150300dpi. Altering this setting resizes the image, both in print and onscreen.

In the Method area, choose how you want the Editor to apply dithering. The 50% Threshold option applies no dithering whatsoeverlight pixels are made white, and dark ones are made black. The Pattern Dither option applies a geometric dithering pattern, which might be adequate if your original image is a simple drawingsuch as a corporate logorather than a photograph. Diffusion Dither applies an error diffusion pattern, distributing vast differences in brightness value over wider areaswhich is generally more appropriate for photographs.

To finalize your choices, click OK .

After changing the color mode of your image, make any other changes you want and then save the final image in JPEG or TIFF format, leaving your PSD image with its layers (if any) intact so that you can return at a later time and make different adjustments if you want.

TIP

If you're curious about what color mode your image is currently using, simply look at the title bar, after the image filename.




Sams Teach Yourself Creating Web Pages All in One
Sams Teach Yourself Creating Web Pages All in One
ISBN: 0672326906
EAN: 2147483647
Year: 2006
Pages: 276

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net