keep transparency of png image with type TYPE_BYTE_INDEXED
Hi, i have a problem with a few png images. they have the type TYPE_BYTE_INDEXED. if i do any resizing or anything else with Graphics2D the transparency is lost..
here is a simple example..
BufferedImage bi = ImageIO.read(new File(args[0]));
double w = 450;
double oriw = bi.getHeight();
double orih = bi.getWidth();
double h = (oriw/orih)*450;
Image image = bi.getScaledInstance(450, (int)h , bi.getType());
BufferedImage biRes =new BufferedImage((int)w,(int)h,bi.getType());
Graphics2D bufImageGraphics = biRes.createGraphics();
bufImageGraphics.drawImage(image, 0, 0,null);
System.out.println(biRes.getType());
ImageIO.write(biRes,"png",new File(args[2]));
my actual java program is more complex like this..
is there anyway to "rescue" the transparency?
p.s. sorry for my bad english ;)

