* becomes a pixel in an image of width 1 and height
* palette.getNumEntries().
*/
public static RGB24Image convertPaletteToImage(Palette palette)
{
RGB24Image result = new MemoryRGB24Image(1, palette.getNumEntries());
for (int index = 0; index < palette.getNumEntries(); index++)
{
result.putSample(INDEX_RED, 0, index, palette.getSample(INDEX_RED, index));
result.putSample(INDEX_GREEN, 0, index, palette.getSample(INDEX_GREEN, index));
result.putSample(INDEX_BLUE, 0, index, palette.getSample(INDEX_BLUE, index));
}
return result;
}