Hi,
I have loaded a 16bit grayscale-tiff to a BufferedImage and want to get
it to screen (using jpanel). But it seems that drawImage can handle only
8bits.
What can I do?
Thx
Marco Schmidt - 11 Jan 2004 14:15 GMT
Mark Trompell:
>I have loaded a 16bit grayscale-tiff to a BufferedImage and want to get
>it to screen (using jpanel). But it seems that drawImage can handle only
>8bits.
Most graphics modes can't handle more than 8 bits per component
anyway. Or are you interfacing some exotic imaging system?
Regards,
Marco

Signature
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
Mark Trompell - 11 Jan 2004 15:08 GMT
Marco Schmidt schrieb:
> Most graphics modes can't handle more than 8 bits per component
> anyway. Or are you interfacing some exotic imaging system?
But there must be away to convert it to 8 bit for the displa. At the
Moment drawImage only gives me noise on the screen because it cuts the
higher bits i think.
> Regards,
> Marco
regards Mark
Marco Schmidt - 11 Jan 2004 19:17 GMT
Mark Trompell:
>But there must be away to convert it to 8 bit for the displa. At the
>Moment drawImage only gives me noise on the screen because it cuts the
>higher bits i think.
BufferedImage#TYPE_USHORT_GRAY should be the right type for 16 bits
grayscale. Are you using that?
You could also create an eight bit version by dropping the least
significant eight bits for display (while keeping the original image
for processing).
Regards,
Marco

Signature
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
Andrew Thompson - 11 Jan 2004 21:58 GMT
| Marco Schmidt schrieb:
|
[quoted text clipped - 4 lines]
| Moment drawImage only gives me noise on the screen because it cuts the
| higher bits i think.
From what you said to ak..
"I need 16 bits for image processing.
I just need 8 bits for the display."
It would seem the strategy is
a) do the processing at 16 bit
b) lose the 'correct' 8 bits before you
feed it to drawImage...
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
ak - 11 Jan 2004 15:06 GMT
> I have loaded a 16bit grayscale-tiff to a BufferedImage and want to get
> it to screen (using jpanel). But it seems that drawImage can handle only
> 8bits.
ImageroReader converts images to 8 bit.
____________
http://reader.imagero.com the best java image reader.
Mark Trompell - 11 Jan 2004 15:11 GMT
ak schrieb:
> ImageroReader converts images to 8 bit.
I need 16 bits for image processing. I just need 8 bits for the display.
Regards Mark
ak - 11 Jan 2004 15:25 GMT
> I need 16 bits for image processing. I just need 8 bits for the display.
then JAI is right thing for you.
____________
http://reader.imagero.com the best java image reader.
Andrew Thompson - 11 Jan 2004 20:26 GMT
| Hi,
| I have loaded a 16bit grayscale-tiff to a BufferedImage and want to get
| it to screen (using jpanel). But it seems that drawImage can handle only
| 8bits.
There are probably better answers coming..
| What can I do?
Lose 8 bits? (..yes, I am serious)
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Mark Trompell - 15 Jan 2004 10:48 GMT
Andrew Thompson schrieb:
> | Hi,
> | I have loaded a 16bit grayscale-tiff to a BufferedImage and
[quoted text clipped - 8 lines]
>
> Lose 8 bits? (..yes, I am serious)
Hi, found a way by using DisplayJAI instead of a panel.But the next
problem is at hand, because I want to use threshold just on one
"ROIShape" instead of the whole image.
But I will open a new Thread.
Thank you for help
Regards Mark
ak - 15 Jan 2004 13:34 GMT
> Hi, found a way by using DisplayJAI instead of a panel.
then you should use PlanarImage, instead of BufferedImage
____________
http://reader.imagero.com the best java image reader.