Can't display PNG image correctly on Java
I am working on a small application which displays JPG and PNG files on screen. I have a PNG file of 4 bit color depth. It doesn't show exact quality in Java as shown in other pic viewer on Windows XP. However, the Java app did display other JPG file of 24bit color depth correctly.
The following is some relative code:
bimg = new BufferedImage(w,h, BufferedImage.TYPE_BYTE_GRAY);
Graphics gbimg = bimg.getGraphics();
gbimg.drawImage(zeImage, 0, 0, null);
Except "TYPE_BYTE_GRAY", I have tried all other field properties. The problem remains.