Hi Nuno,

  you can do this, for example, this way:
  BufferedImage bi = ..; // your image
  BufferedImage grayBi = new BufferedImage(bi.getWidth(), getHeight(),
                                           BufferedImage.TYPE_BYTE_GRAY);
  Graphics g = grayBi.getGraphics();
  g.drawImage(bi, 0, 0, null);

  Now you have a grayscale version of the bi image in the grayBi.

  Thank you,
    Dmitri

On Fri, Apr 05, 2002 at 08:30:0p +0100, Nuno Emanuel Figueiredo de Carvalho wrote:
 > Hi,
 >
 >     Could someone help me on getting a grayscale image from a BufferedImage
 > ?
 >     I already checked some source code from web but it doesn't work.
 >
 >     Please help me!!!!
 >
 > Regards,
 >     Nuno
 >
 > ===========================================================================
 > 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".

===========================================================================
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".

Reply via email to