This isn't strictly a Java2D question, but I thought someone here might know the answer ...
 
I'm drawing grayscale images into an offscreen BufferedImage and then using drawImage to display them in the paint (or paintComponent) event.  I set the FORCEGRAYS environment variable to ensure the maximum number of grays in the palette.  I find that if I use a buffered image created as follows
 
  m_image = new java.awt.image.BufferedImage(xDim,yDim,java.awt.image.BufferedImage.TYPE_BYTE_INDEXED,m_icm);
 
performance is awful, but I get a gray ramp which makes use of all the available grays.  When I create the BufferedImage as follows

  m_image = new java.awt.image.BufferedImage(xDim,yDim,java.awt.image.BufferedImage.TYPE_BYTE_GRAY);
 
performance is better by a factor of almost 4, but the ramp is streaky, since not all the available grays are used.
 
Here's the machine configuration
 
WinNT v4 sp4
java version "1.3.0rc2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc2-Y)
Java HotSpot(TM) Client VM (build 1.3.0rc2-Y, mixed mode)
8-bit framebuffer
FORCEGRAYS=Y
 
Thanks for any suggestions,
Fred
 
---
J F Stevens
[EMAIL PROTECTED] (sic)
610/407-4476 (voice)
425/871-0808 (FAX)

Reply via email to