Performance of PixelGrabber

Hi there!

I am currently writing something like an AlphaComposite for java-1.1 based java implementations, since I need it for a special case.

I do the whole thing with pixelgrabber/filter and it works ugly and very slow :frowning:
The problem I am having is, that the filtering itself and even the new image creation work very fast, however the PixelGrabber is slowing down everything.

I get the pixel-data from an managed toolkit image with the following code:



alphaGrabber =  new PixelGrabber(alphaImg, 0, 0, alphaImg.getWidth(null), alphaImg.getHeight(null), false);
        
try
{
   alphaGrabber.grabPixels();
}catch(InterruptedException ex){}

It takes 500ms for a 500x500 image! Isn’t there any way to render into an int[] via software-rendering or another trick so that I do not have to grab the image-content every time I wont to flush my alpha-buffer?

Thanks in advance, lg Clemens

Which vm are you running this on? If it’s everything post 1.4, PixelGrabber being slow is a known problem (if I’m not mistaken, the bug synopsis says 600 times slower =( ).

How do you create the image?
Could you post a simple test?

Dmitri

well I simply create the image with:
Component.createImage(…)