One approach using JAI is given in the attached message.

Brian

>How can I convert a BufferedImage of type TYPE_INT_RGB, to a
>TYPE_BYTE_INDEX ?
>
>I'm trying to save the image into a bmp file, yet, the JAI bmp codec
>doesn't let me save images
>that hold data in ushort, int, long etc., just byte types.


Delete.
This is a system message.















--END+PSEUDO--

>From bpb@ha3mpk  Fri Jan 26 10:40:21 2001
Date: Fri, 26 Jan 2001 10:40:21 -0800 (PST)
From: Brian Burkhalter <bpb@ha3mpk>
Subject: Re: [JAI] Saving a BufferedImage into a BMP file.
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
X-Mailer: dtmail 1.3.0 CDE Version 1.3 SunOS 5.7 sun4u sparc
Mime-Version: 1.0
Content-Type: TEXT/plain; charset=us-ascii
Content-MD5: l2rgRwUCpP/NPvBOrD3ynA==
Content-Length: 1024
Status: RO
X-Status: $$$$
X-UID: 0000000001

Augusto,

Try passing the image through the "format" operator with data type parameter
DataBuffer.TYPE_BYTE and then write the output of "format" to the file or
stream.

Brian

>I'm trying to save a BufferedImage into a BMP file using JAI.
>
>The image is originally TYPE_INT_ARGB, but when I try to save it,
>I get an error saying "only 1 and 3 planar" images can be saved.
>
>So, I changed the image to be TYPE_INT_RGB, then I get a message saying
>I can't save images of type ushort, int, etc.
>
>It seems like the only type of image I can save is BYTE. Now, what is
>the *easiest*
>way, to take a color image and convert it into a BYTE type image that
>can be saved
>under JAI as a BMP file ???
>
>Thanks !
>
>Augusto
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff JAI-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".




Reply via email to