Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

show 16bit greyscale BufferedImage on screen

Thread view: 
Mark Trompell - 11 Jan 2004 13:53 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.
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.