Many times in electronic imaging systems it is necessary to reduce the precision of the digital data for the display, storage, manipulation, or transformation of an image. For example, it may be necessary to reduce 12 bits/channel RGB data to 8 bits/channel due to storage requirements. To accomplish this reduction in the number of digital levels, a series of input levels must be grouped together for each output level. Since this process involves the quantization of previously quantized data, it is sometimes referred to as secondary quantization. The secondary quantization process necessarily results in artifacts, such as contouring in the image, where many colors have been mapped to a single color. Conventional methods, such as linear or power-law resampling, are suboptimal and do not consider intercolor effects. This paper describes a method for determining the quantization functions that will minimize the observable image artifacts generated by the secondary quantization process. The basic approach involves the use of nonlinear optimization techniques to minimize a cost function that provides a measure of the visible color error. Examples are presented that compare the optimized quantization process to conventional techniques.