Don, Michael is right – JPEG doesn’t
retain the number of different colors
in an image. A test, using my own image
processing system which can count the
number of colors, for 1.000.000 pixels
(1 million):
Original 640.000 colors (number rounded)
Indexed 256 colors
JPEG 188.000 colors (number rounded)
The JPEG looks like the Indexed Color
image, but the number of colors is much
larger. This happens because of several
processes: color subsampling, forward
and reverse quantization, as described
here:
<
http://www.fho-emden.de/~hoffmann/jpeg131200.pdf>
Best regards –Gernot Hoffmann