} else {
if (!(image.getColorModel() instanceof IndexColorModel)) {
// try to force a RGBA setup
image = new ImageWorker(image).rescaleToBytes().forceComponentColorModel()
.getRenderedImage();
ColorIndexer indexer = null;
// user provided palette?
if (mapContent.getPalette() != null) {
indexer = new CachingColorIndexer(new LRUColorIndexer(icm, 1024));
} else if (palettedFormatName.equalsIgnoreCase(format)) {