Just a note, regardless of the algorythm you're using, set/getRGB is a very inefficient way to work with pixels. A better would be to get the DataBuffer's array (bufferedImage.getRaster().getDataBuffer()) and operate directly on the pixels.
The disadvantage of this approach is that Java2D won't be able to cache this image in video memory because you have direct access to the pixels and we can't guarantee that the cache will be up to date.
Thanks,
Dmitri
Java2D Team |