// Mostly just a hack. Ignores numberColors and more.
// TODO What should the alpha be? And even for this, why does 255 work? Shouldn't it be 1?
float[][] matrix = new float[][]{{0.299f, 0.587f, 0.114f, 0},
{0.299f, 0.587f, 0.114f, 0}, {0.299f, 0.587f, 0.114f, 0}, {0, 0, 0, 255}};
BandCombineOp bandOp = new BandCombineOp(matrix, null);
bandOp.filter(getImage().getRaster(), result.getImage().getRaster());
} else {
// Um, obviously wrong here.
result.composite(this, 0, 0, CompositeOperator.OVER);
}
result.setFormat(this.getFormat());