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!

[433 byte] By [obirenokenobia] at [2007-11-26 20:40:30]
# 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
Rodney_McKaya at 2007-7-10 1:58:50 > top of Java-index,Security,Cryptography...
# 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.
obirenokenobia at 2007-7-10 1:58:50 > top of Java-index,Security,Cryptography...
# 3
Do you mean java.awt.Image?This is an abstract class to get the real image class print the image class:System.out.println(image.getClass());What is this scanner and how are you obtaining the object Image from it?
Rodney_McKaya at 2007-7-10 1:58:50 > top of Java-index,Security,Cryptography...