a compression method therefore if the number of colors is initially determined to be greater than 256 in the described embodiment an attempt is made to u201c discard u201d some colors and substitute nearby colors so that the total number of colors is less than or equal to 256 initially the number of colors u201c y u201d which are used relatively infrequently is determined block 201 in the described embodiment a color is considered to be used infrequently if it is used for less than u2155 of 1 of the total pixels in the data file of course in alternate embodiments some other threshold may be chosen next a determination is made whether there are sufficient colors to discard e g if there are enough discardable colors to reduce the total pixel count below 256 the total number of colors required to be discarded u201c z u201d is computed simply as x u2212 256 where x is the total number of colors block 202 if y is greater than or equal to z there are sufficient colors to discard block 203 otherwise no pixels are discarded and as discussed in connection with fig1 jpeg is chosen as the compression method assuming there are.