Photoshop

Convert a grayscale or RGB image to indexed color

Converting to indexed color reduces the number of colors in the image to at most 256—the standard number of colors supported by the GIF and PNG‑8 formats and many multimedia applications. This conversion reduces file size by deleting color information from the image.

To convert to indexed color, you must start with an image that is 8 bits per channel and in either Grayscale or RGB mode.

  1. Choose Image > Mode > Indexed Color.
    Note: All visible layers will be flattened; any hidden layers will be discarded.

    For grayscale images, the conversion happens automatically. For RGB images, the Indexed Color dialog box appears.

  2. Select Preview in the Indexed Color dialog box to display a preview of the changes.
  3. Specify conversion options.

Conversion options for indexed-color images

When converting an RGB image to indexed color, you can specify a number of conversion options in the Indexed Color dialog box.

Palette Type
A number of palette types are available for converting an image to indexed color. For the Perceptual, Selective, and Adaptive options, you can choose using a local palette based on the current image’s colors. These are the available palette types:
Exact
Creates a palette using the exact colors appearing in the RGB image—an option available only if the image uses 256 or fewer colors. Because the image’s palette contains all colors in the image, there is no dithering.

System (Mac OS)
Uses the Mac OS default 8‑bit palette, which is based on a uniform sampling of RGB colors.

System (Windows)
Uses the Windows system’s default 8‑bit palette, which is based on a uniform sampling of RGB colors.

Web
Uses the 216-color palette that web browsers, regardless of platform, use to display images on a monitor limited to 256 colors. This palette is a subset of the Mac OS 8‑bit palette. Use this option to avoid browser dither when viewing images on a monitor display limited to 256 colors.

Uniform
Creates a palette by uniformly sampling colors from the RGB color cube. For example, if Photoshop takes six evenly spaced color levels each of red, green, and blue, the combination produces a uniform palette of 216 colors (6 cubed = 6 x 6 x 6 = 216). The total number of colors displayed in an image corresponds to the nearest perfect cube (8, 27, 64, 125, or 216) that is less than the value in the Colors text box.

Local (Perceptual)
Creates a custom palette by giving priority to colors for which the human eye has greater sensitivity.

Local (Selective)
Creates a color table similar to the Perceptual color table, but favoring broad areas of color and the preservation of web colors. This option usually produces images with the greatest color integrity.

Local (Adaptive)
Creates a palette by sampling the colors from the spectrum appearing most commonly in the image. For example, an RGB image with only the colors green and blue produces a palette made primarily of greens and blues. Most images concentrate colors in particular areas of the spectrum. To control a palette more precisely, first select a part of the image containing the colors you want to emphasize. Photoshop weights the conversion toward these colors.

Custom
Creates a custom palette using the Color Table dialog box. Either edit the color table and save it for later use or click Load to load a previously created color table. This option also displays the current Adaptive palette, which is useful for previewing the colors most often used in the image.

Previous
Uses the custom palette from the previous conversion, making it easy to convert several images with the same custom palette.

Number Of Colors
For the Uniform, Perceptual, Selective, or Adaptive palette, you can specify the exact number of colors to be displayed (up to 256) by entering a value for Colors. The Colors text box controls only how the indexed color table is created. Adobe Photoshop still treats the image as an 8‑bit, 256‑color image.

Color Inclusion And Transparency
To specify colors to be included in the indexed color table or to specify transparency in the image, choose from the following options:
Forced
Provides options to force the inclusion of certain colors in the color table. Black And White adds a pure black and a pure white to the color table; Primaries adds red, green, blue, cyan, magenta, yellow, black, and white; Web adds the 216 web‑safe colors; and Custom lets you define custom colors to add.

Transparency
Specifies whether to preserve transparent areas of the image during conversion. Selecting this option adds a special index entry in the color table for transparent colors. Deselecting this option fills transparent areas with the matte color, or with white if no matte color is chosen.

Matte
Specifies the background color used to fill anti-aliased edges that lie adjacent to transparent areas of the image. When Transparency is selected, the matte is applied to edge areas to help blend the edges with a web background of the same color. When Transparency is deselected, the matte is applied to transparent areas. Choosing None for the matte creates hard-edged transparency if Transparency is selected; otherwise, all transparent areas are filled with 100% white. The image must have transparency for the Matte options to be available.

Dithering
Unless you’re using the Exact color table option, the color table may not contain all the colors used in the image. To simulate colors not in the color table, you can dither the colors. Dithering mixes the pixels of the available colors to simulate the missing colors. Choose a dither option from the menu, and enter a percentage value for the dither amount. A higher amount dithers more colors but may increase file size. You can choose from the following dither options:
None
Does not dither colors but instead uses the color closest to the missing color. This tends to result in sharp transitions between shades of color in the image, creating a posterized effect.

Diffusion
Uses an error-diffusion method that produces a less structured dither than the Pattern option. To protect colors in the image that contain entries in the color table from being dithered, select Preserve Exact Colors. This is useful for preserving fine lines and text for web images.

Pattern
Uses a halftone-like square pattern to simulate any colors not in the color table.

Noise
Helps to reduce seam patterns along the edges of image slices. Choose this option if you plan to slice the image for placement in an HTML table.