Image bit depth, Image loaded in memory, NOT in file
Hi! I've an Image object loaded in memory and want to know which is its bit depth. Like, if it is a 1 bit depth so I can get a BufferedImage as a TIFF, or perhaps is a 24 bit depth and I can compress it with LZW, etc. The important thing here, is that the Image is in memory, not a file. I know how to get the bit depth from an image in a file, but this object is in memory.
Thanks a lot for your help, dukes available!
# 1
What do you mean object loaded in memory?Do you have a BufferedImage object?If so, you can use getType() to get the type of the image.You can read in the API the meaning of each type: http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/BufferedImage.html
# 2
Nope, I don't have a BufferedImage, since I need to set the Type of the BufferedImage. What I'm doing is obtaining an object Image from a scanner, but after I receive it, and before doing anything like write it to the disk, I want to know which its bit depth is.