> ---------- > From: Hock, Gregg > Sent: Wednesday, September 08, 1999 7:36 AM > To: '[EMAIL PROTECTED]' > Subject: RE: [JAVA3D] Creating Transparent Images > > I'm not sure if the limitation exists just for jpeg/jfif created using the > com.sun.image.codec.jpeg package or for all jpeg's. I have some .jpg > files created from xpm files that are transparent AND they show up > transparent when textured on QuadArrays in our Java3D app. > > Help... > > Gregg > > ---------- > From: Kabriel Robichaux[SMTP:[EMAIL PROTECTED]] > Reply To: [EMAIL PROTECTED] > Sent: Tuesday, September 07, 1999 7:04 PM > To: [EMAIL PROTECTED] > Subject: Re: [JAVA3D] Creating Transparent Images > > It is my understanding that JPEG/JFIF can not have an alpha channel, at > least in it's serialized form. I would suggest using PNG. > > ... > Kabe > > > -----Original Message----- > > From: Discussion list for Java 3D API > > [mailto:[EMAIL PROTECTED]]On Behalf Of Hock, Gregg > > Sent: Tuesday, September 07, 1999 3:41 PM > > To: [EMAIL PROTECTED] > > Subject: [JAVA3D] Creating Transparent Images > > > > > > Folks, > > How does one use the com.sun.image.codec.jpeg package to create an image > > that includes alpha values. I have an array of Point4f values > > representing > > red,green,blue and alpha. I have successfully created jpeg images from > an > > array of Point3f values (rgb only) using a BufferedImage and > > Raster. I read > > in the JPEGEncodeParam documentation that an alpha rgb BufferedImage > will > > not map to a valid JFIF stream. The runtime error occurs on the > > creation of > > a JPEGEncodeParam object: > > ...jpeg.codec.ImageFormatException: 4 band JFIF files imply CMYK > encoding. > > > > Code snibit: > > > > BufferedImage bi = new > > BufferedImage(width,height,BUFFEREDIMAGE.TYPE_4BYTE_ABGR); > > ColorModel cm = bi.getColorModel(); > > Raster ra = bi.getAlphaRaster(); > > //fill raster in a loop > > ra.setPixel(x,y,abgr); //where abgr is a 4 byte array > > //Create encoder > > BufferedOutputStream bos = new BufferedOutputStream(fos); > > JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(bos); > > //Create param object using raster and color_id > > int cid = jie.getDefaultColorId(cm); > > JPEGEncodeParam jep = new JPEGEncodeParam(ra,cid); > > > > Please comment.... > > > > Thanks, > > Gregg > > > > ================================================================== > > ========= > > To unsubscribe, send email to [EMAIL PROTECTED] and include > > in the body > > of the message "signoff JAVA3D-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 JAVA3D-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 JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
