Hi all! I have the following problem: I have a Buffered image, then I want to transcode it into as small as possible format for wireless transfer. The most suitable format is PNG and since the wireless devices usually only support monochrome images, I want to encode the image in this mode. Therefore I create an IndexColorModel with two palette entries, black and white. Then I call a colorConvertOp.filter(srcImg,destImg), where destImage has the aforementioned monochrome IndexColorModel. While this works procedure, it is still missing a piece. The problem is the destImg looks quite bad, the light parts of the image are totally white, while others are totally black. What I want is a dithered BW image that would show some "grayness".
The question is: how do I dither an image? Specifically, how do I dither the image to two colors? I'm not familiar with the dithering algorithm, so I was wondering if there is some BufferedImageOp or RasterOp that can be configured to pose as dithering operation? Can dithering be expressed as a convolution or is it a totally another kind of operation? If yes, can someone point me to an appropriate kernel, if not, does someone have this operation implemented? I need a Java algorithm, preferebly something that works hand-in-hand with BufferedImage concepts. Thanks in advance, Samo =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".