OperationFailedException,
WrongParameterException
{
ensureInputImageIsAvailable();
ensureImagesHaveSameResolution();
PixelImage in = getInputImage();
if (in instanceof RGB24Image)
{
list = createColorList((RGB24Image)in);
}
else
{
throw new WrongParameterException("Input image must implement RGB24Image.");
}
root = new MedianCutNode(null, 0, list.getNumEntries() - 1);
root.setMinColor(0, 0, 0);
root.setMaxColor(maxValue, maxValue, maxValue);
findPalette();
if (doNotMap)
{
return;
}
PixelImage out = getOutputImage();
if (getTruecolorOutput())
{
if (out == null)
{
out = in.createCompatibleImage(in.getWidth(), in.getHeight());