comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: View 24-bit images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: View 24-bit images [message #18815] Fri, 04 February 2000 00:00
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"Alvaro T." wrote:

> Thanks to both. Now I understand it. But I still have the same problem
> because I only have a matrix of, for example, 100x100 values with data
> from -32000 to 32000 (is that Long, Int...? I don't know...). Should I
> change the type data before draw it?
> Imagine that a guy send to you a 100x100 matrix with data from -32000 to
> 32000 values. How will you show it in the screen? I don't need show it in
> colors, only in grey levels.

Alvaro,

I think we're getting to the root of the problem now. When you said '24-bit'
images in your original post, I assumed you meant a True Color image with red,
green, and blue components. However I think you actually have a short or long
integer array that you wish to display as a Pseudo Color image. Here are some
tips:

(1) To find the type and size of the array, use 'help', e.g.

image = dist(256)
help, image

(2) When reading from HDF files, IDL preserves the data type. So if the array
was a short integer in the HDF file, it will be a short integer in IDL.

(3) Regardless of the type of your array (short, long, float, double), it must
be scaled to byte values in order to be displayed as an image. If you wish to
use built-in IDL commands for byte scaling, you can use either TVSCL or BYTSCL,
e.g.

tvscl, image
tv, bytscl(image)

Both of these commands display a scaled version of your image, where the
minimum to maximum array values are linearly mapped to byte image values in the
range 0 to !D.TABLE_SIZE - 1. If you wish to select a certain data range in the
input array, then BYTSCL accepts the MIN and MAX keywords, e.g.

tv, bytscl(image, min=0.0, max=125.0)

(4) IMDISP byte-scales the input array by default, either from minimum to
maximum, or over a range you specify, e.g.

imdisp, image
imdisp, image, range=[0.0, 125.0]

IMDISP also offers a plethora of other advantages which you can read about at
http://cimss.ssec.wisc.edu/~gumley/imdisp.html

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
Re: View 24-bit images [message #18816 is a reply to message #18815] Fri, 04 February 2000 00:00 Go to previous message
Alvaro is currently offline  Alvaro
Messages: 6
Registered: December 1999
Junior Member
Liam wrote:

> Just so we're talking about the same thing, True Color images must have
> dimensions of the form
> [3, NX, NY] or [NX, 3, NY] or [NX, NY, 3]
> where NX is the width of the image (number of columns), NY is the height of
the
> image (number of rows), and the dimension 3 refers to the red, green, and
blue
> image planes.
- - - - - - - - - - - - - - -

David Zwarg wrote:

> Try :
> tv,imagedata,/TRUE
> If you're dealing with a color image, it is typically a 3,x,y dimensioned
array. /true is how
> you view the three overlapping arrays together as a color image.


Thanks to both. Now I understand it. But I still have the same problem
because I only have a matrix of, for example, 100x100 values with data
from -32000 to 32000 (is that Long, Int...? I don't know...). Should I
change the type data before draw it?
Imagine that a guy send to you a 100x100 matrix with data from -32000 to
32000 values. How will you show it in the screen? I don't need show it in
colors, only in grey levels.


____________________________________ ___ __ _
Alvaro, atarela@usc.es
University of Santiago de Compostela (SPAIN)
Re: View 24-bit images [message #18819 is a reply to message #18815] Fri, 04 February 2000 00:00 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"Alvaro T." wrote:

> I' having problems about viewing 24-bit images.
> I have got an image in HDF format. The data is stored as INT (from -32000 to
> 32000) and use the HDF_... functions to get the image data. For viewing the
> data in the screen, I use:
>
> TV, imagedata, Order=1
>
> but almost I can't see anythig!. So, I try:
>
> TVScl, imagedata, Order=1
>
> Now I can see the image, but only 256 colors (or grey levels), so I'm losing
> bit values. Why?
> I'm using Windows in 32-bits mode and IDL has: !D.N_Colors=16777216,
> !D.Table_Size=256

Alvaro,

Just so we're talking about the same thing, True Color images must have
dimensions of the form

[3, NX, NY] or [NX, 3, NY] or [NX, NY, 3]

where NX is the width of the image (number of columns), NY is the height of the
image (number of rows), and the dimension 3 refers to the red, green, and blue
image planes.

My IMDISP procedure does (IMHO) an excellent job of displaying True Color
images or Pseudo Color images, e.g.

read_jpeg, filepath('rose.jpg', subdir='examples/data'), image
imdisp, image
imdisp, image, order=1

Check out http://cimss.ssec.wisc.edu/~gumley/imdisp.html

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
Re: View 24-bit images [message #18821 is a reply to message #18815] Fri, 04 February 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Alvaro T. (atarela@usc.es ) writes:

> I' having problems about viewing 24-bit images.
> I have got an image in HDF format. The data is stored as INT (from -32000 to
> 32000) and use the HDF_... functions to get the image data. For viewing the
> data in the screen, I use:
>
> TV, imagedata, Order=1
>
> but almost I can't see anythig!. So, I try:
>
> TVScl, imagedata, Order=1
>
> Now I can see the image, but only 256 colors (or grey levels), so I'm losing
> bit values. Why?
> I'm using Windows in 32-bits mode and IDL has: !D.N_Colors=16777216,
> !D.Table_Size=256
>
> Who can help me? I'm a bit "lost" with managing colors in IDL.

Set the TRUE keyword to reflect the interleaving of your
24-bit image. Something like this:

TV, imagedata, True=1

Or, just use my TVIMAGE program, which is smart
enough to figure out if you have a 24-bit or 8-bit
image and set the proper keywords, decomposed state,
etc, etc. Saves you a LOT of coding to make the
display of an image device independent. :-)

http://www.dfanning.com/programs/tvimage.pro

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: READING MPEG FILES
Next Topic: 5.0.3 segfault?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:10:02 PDT 2025

Total time taken to generate the page: 0.22625 seconds