I know how to do posterization for image processing, such as below...
public BufferedImage doPosterization (BufferedImage inputImage,
int posterizationVa lue) {
short[] posterize = new short[256];
for (int i = 0; i < 256; i++) {
posterize[i] = (short) (i - (i % posterizationVa lue));
}
BufferedImageOp op = new LookupOp(new ShortLookupTabl e(0, posterize),
null);
BufferedImage mBufferedImage = op.filter(input Image, null);
return mBufferedImage;
}
But how to do posterzation just on blue element? where the posterization value will be inputted by the user.
Thanks!
public BufferedImage doPosterization (BufferedImage inputImage,
int posterizationVa lue) {
short[] posterize = new short[256];
for (int i = 0; i < 256; i++) {
posterize[i] = (short) (i - (i % posterizationVa lue));
}
BufferedImageOp op = new LookupOp(new ShortLookupTabl e(0, posterize),
null);
BufferedImage mBufferedImage = op.filter(input Image, null);
return mBufferedImage;
}
But how to do posterzation just on blue element? where the posterization value will be inputted by the user.
Thanks!
Comment