Re: read_tiff - simple question [message #14507 is a reply to message #14502] |
Sun, 28 February 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Harald von der Osten-Woldenburg (hvdosten@ludwigsburg.netsurf.de) writes:
> I am trying to read an existing tiff image. Doing this exactly as
> proposed in the online help menue I only get error messages. For
> example:
>
> device, true=24
> image=read_tiff(�zeraqon.tif�, r, g, b)
> tvlct, r, g, b
> tv, image
>
> leads to the error message unknown variable r in tvlct. What is missing?
My guess is that this is a 24-bit image in this
TIFF file, so there are no R, G, and B vectors that
would create an associated color palette. The RGB
information is included inside the image itself. You
can easily test this by looking at image, r, g, and b
with the HELP command:
Help, image, r, g, b
I think you will find that image is a 3-by-m-by-n array
and that r, g, and b are undefined. Try this code:
Device, True=24
image = Read_Tiff('zeragon.tif')
TV, image, True=1 ; if image is 3-by-whatever
You can find out exactly what is in the TIFF file before
you try to read it by using the new QUERY_TIFF function:
is_tiff = Query_TIFF('zeragon.tif', tiff_info)
IF is_tiff THEN Help, tiff_info, /Structure ELSE $
Print, 'Not a TIFF file'
This will tell you whether the file contains a palette,
whether it is a 24-bit or 8-bit image, what its dimensions
are, etc. Very handy.
> By the way: Does something exist like an archive including all the
> discussion in this newsgroup, so that beginners like me can first have a
> look on this before asking such simple questions in this newsgroup?
You can always visit the IDL FAQ, maintained by Mike
Schienle at:
http://www.ivsoftware.com/pub/idl_faq.html
And I have plenty of IDL programming tips on my site as well:
http://www.dfanning.com/documents/tips.html
But I don't think anyone minds simple questions in the newsgroup
if the people seeking answers are sincere in their efforts to
learn IDL. :-)
Cheers,
David
P.S. I've just received the latest batch of IDL books from
the printer. This version has been updated rather extensively
for IDL 5.2. I have also increased the amount of discussion
on 8-bit verses 24-bit image display, as this continues to
be a source of confusion for many IDL users as we make the
transition from 8-bit to 24-bit computers.
I also have about 8 books from the previous Dec 98 version of the
book that I will sell to students cheaply, if anyone is interested.
--
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
[Note: This follow-up was e-mailed to the cited author.]
|
|
|