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

Home » Public Forums » archive » Re: color tiffs
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: color tiffs [message #72364] Sat, 04 September 2010 10:14 Go to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 4, 1:43 pm, Hawaiianite <jtmcah...@gmail.com> wrote:
> I can't seem to get tiffs written out in color.  Silly, but true.
>
> IDL> write_tiff,'title',(array[*,*,2]),/float
>
> I get a grey scale image even when I've set device,decomposed=0 and
> loaded a color table (39).  The resulting file is larger compared to
> the black and white tiffs I produced with bytscl'ing', but it is not
> in color.  Any suggestions?
>
> Thanks!

Besides the points David mentioned, note that the device routine and
the current colortable only affect things done to direct graphics
devices. write_tiff has nothing to with direct graphics.
Re: color tiffs [message #72365 is a reply to message #72364] Sat, 04 September 2010 09:57 Go to previous messageGo to next message
David Grier is currently offline  David Grier
Messages: 35
Registered: July 2010
Member
On 9/4/10 12:43 PM, Hawaiianite wrote:
> I can't seem to get tiffs written out in color. Silly, but true.
>
> IDL> write_tiff,'title',(array[*,*,2]),/float
>
> I get a grey scale image even when I've set device,decomposed=0 and
> loaded a color table (39). The resulting file is larger compared to
> the black and white tiffs I produced with bytscl'ing', but it is not
> in color. Any suggestions?
>
> Thanks!

How about ...

IDL> write_tiff, 'title', array[*,*,0:2], /float

The command you provided above creates a tiff image with only one color
channel (index 2), and thus yields a grayscale image. Storing
a color image requires all three color channels, which I assume
are in indices 0, 1, and 2 of "array". I also assume that you're not
using indexed colors because you're storing pixels as floating-point
values. If you were using indexed colors, you'd have to save the
color table in the write_tiff command.

The floating-point image created by your command is larger than a
bytscl'ed image because each floating-point pixel requires 4 bytes (?),
whereas each bytscl'ed pixel requires just one.

TTFN,

David
Re: color tiffs [message #72524 is a reply to message #72364] Fri, 17 September 2010 07:22 Go to previous message
jtmcahill is currently offline  jtmcahill
Messages: 26
Registered: October 2007
Junior Member
On Sep 4, 1:14 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Sep 4, 1:43 pm, Hawaiianite <jtmcah...@gmail.com> wrote:
>
>> I can't seem to get tiffs written out in color.  Silly, but true.
>
>> IDL> write_tiff,'title',(array[*,*,2]),/float
>
>> I get a grey scale image even when I've set device,decomposed=0 and
>> loaded a color table (39).  The resulting file is larger compared to
>> the black and white tiffs I produced with bytscl'ing', but it is not
>> in color.  Any suggestions?
>
>> Thanks!
>
> Besides the points David mentioned, note that the device routine and
> the current colortable only affect things done to direct graphics
> devices. write_tiff has nothing to with direct graphics.

Ok, well is there a way I can make a color tiff with one channel? I
need to keep the channels separate in displaying this data...

Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Is there anyway to retrieve events from plot in IDL 8.0
Next Topic: Re: Renaming tags in an array of structures

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

Current Time: Wed Oct 08 15:10:19 PDT 2025

Total time taken to generate the page: 0.00633 seconds