Changing the palette of an image using IndexColorModel
Hi
How can I rapidly and often change the palette of a BufferedImage which uses an IndexColorModel? The only palette changes I want to implement are the colors, not the number of bits, palette size, transparencies or the transparent index.
The IndexColorModel class contains a private field rgb[] which I obviously cannot get a reference of, and two private methods IndexColorModel.setRGBs which only seem to be invoked from within the constructors.
Creating new IndexColorModel instances on the fly when I draw the same images (small icons) lots of times with different palettes (either as animation or as duplicates) creates unnecessary initialization overhead and garbage.
Is there another way to get the same effect?

