Samo, While this does not directly reply to your question please note that 8-to-1 bit dithering is possible using Java Advanced Imaging. Sample code for dithering using the "ErrorDiffusion" and "OrderedDither" operations is provided at
http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0110&L=jai-interest&P=R28205 Note that in the example a BufferedImage could be used as the source image of either operation. Brian > 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. =========================================================================== 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".