Hi,

we are developing a comercial application in Java and we have many problems rendering the image, mainly because the velocity.

The images that we are trying to render to the screen are B/W (1bpp) bitmaps with around 2550*3300 pixels. We have implemented several approches but no one of them is fast enough:

  • The fastest approach was java 1, by using the producer-consumer model, made a conversion from the bitmap to a bytemap (in JNI) (each bit becomes a byte) and handle Image objects. The scaling and rendering of Image objects is not so slow. However, this one was the initial approach, currently implemented in our product, which results too slow for our customers.
  • After that we tried using 2D API to try to speed up the image rendering. We save time avoiding the conversion bitmap-bytemap by using BufferedImages with 1bpp, but when we tried to render the BufferedImage, we found that rendering is very fast without scaling, but as we need to scale the drawing, the performnace goes down drastically. Consequence is too slow.
  • A new idea was: as BufferedImage creation is fast, (does not need conversion bitmap-bytemap), and Image scaling and rendering is fast (java 1), we tried the following process:
        • create the drawing in a BufferedImage
        • draw the BufferedImage in a Image offscreen
        • scale and render the Image object
    However the copy of BufferedImage on a Image is also too slow:
      BufferedImage bufimg = new BufferedImage(ColorModel, raster, false, null);
      img = createImage(width, height);
      Graphics2D g2 = (Graphics2D)img.getGraphics();
      g2.drawImage(bufimg, null, this);
      bufimg.flush();
       
  • We have also tried other options as coping the BufferedImage 1bpp to a BufferedImage TYPE_INT_RGB but all slow.
The questions are:
Are we doing wrong some of the previous process or the resuls that we get are expected??? Do you have any idea or workaround about how to render fast such a kind of images???
Any help would be grateful.

I would appreciate a soon response since this subject is hurrying us. Thanks in advance,

Adolfo Rodriguez. ([EMAIL PROTECTED])

Reply via email to