}
int width = src.getWidth();
int height = src.getHeight();
boolean hasAlpha = new PaletteFactory().hasTransparency(src);
int max_colors = hasAlpha ? 255 : 256;
Palette palette2 = new PaletteFactory().makePaletteSimple(src,
max_colors);
// int palette[] = new PaletteFactory().makePaletteSimple(src, 256);
// Map palette_map = paletteToMap(palette);
if (palette2 == null)
{
palette2 = new PaletteFactory().makePaletteQuantized(src,
max_colors);
if (verbose)
System.out.println("quantizing");
} else if (verbose)
System.out.println("exact palette");