index++;
}
}
}
}
Paletted8Image out = new MemoryPaletted8Image(in.getWidth(), in.getHeight(), palette);
for (int y = 0; y < in.getHeight(); y++)
{
for (int x = 0; x < in.getWidth(); x++)
{
int red = in.getSample(RGBIndex.INDEX_RED, x, y) >> 8;
int green = in.getSample(RGBIndex.INDEX_GREEN, x, y) >> 8;
int blue = in.getSample(RGBIndex.INDEX_BLUE, x, y) >> 8;
out.putSample(0, x, y, hist.getEntry(red, green, blue));
}
setProgress(y, in.getHeight());
}
outputImage = out;
}