Java ImageIO Grayscale PNG Issue
I have a grayscale image ("lena" actually) which I want to experiment with. I got it as a 512x512 PNG file with 216 shades of gray. What happens is, when I read it with Java ImageIO, like that: String name = args[0]; File fi = new File(name); BufferedImage img = ImageIO.read(fi); I get a BufferedImage with only 154 colours ! I only realized this, cause my processed images which looked sallow, lacking deep black. Even more irritating, when I use XnView convert the PNG to a GIF, which is a lossless procedure in this case, read the GIF with above code, I get all 216 colours in my BufferedImage.