Re: How do you make an BufferedImage transparent.
Posted By:
AlessandroA_Garbagnati
Posted On:
Tuesday, May 1, 2001 04:48 PM
Hi,
It looks like the color model that you are using doesn't have the transparent value set.
I've had a similar problem with the same encoder, but I was generating the image on the fly, so when I was creating the BufferedImage, I've used an IndexColorModel that I've build defining (in the contructor) which one was the transparent color:
public IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b, int trans);
Now I've finally moved to jpeg. Sun's Jpeg encoder and decoder are way faster than the acme's encoder. The only problem is that JPeg has no transparency, but setting the background to the right color does the trick most of the times.