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

Home » Public Forums » archive » Re: How-to? color png
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How-to? color png [message #27625 is a reply to message #27624] Tue, 30 October 2001 15:24 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
From: "Andrew Cool" <andrew.cool@dsto.defence.gov.au>
> "Bernard K." wrote:
>>
>> I tried all the combinations proposed and they all work nicely. For the
>> surface I plot (and on my super-dupper mac :-) with the number of
>> colors used set to 256) the output I prefer is obtained by:
>>
>> tvlct, r, g, b, /get
>> and
>> write_png, 'image.png', datar,r,g,b
>> However I have to set decomposed to 1.
>
> Ockam's Razor wins again.

Ockam's Razor may help in understanding the universe but I don't think it
helps with IDL, which is *much* more complicated.

Or to put it another way, if David didn't spend his time writing code that
copes with *any* combination of colour depths, colour models, device
settings and IDL versions, then what would he do with his time?

Actually, there is a limitation with the above method. When the colour depth
is 24-bit, it is possible to issue successive graphics command to the same
window with different colour tables. In fact it might even be useful, eg:

loadct, 2 ; Load a nice colourful colour table
tv, ... ; Draw an image
loadct, 0 ; Load a boring grey-scale colour table
xyouts, ... ; Annotate the plot

This is arguably easier than using a single colour table & reserving some
indices for the annotation colours.

But if you then read the image with the above method, the tvlct command will
retrieve the current (grey-scale) colour table and the PNG file will look
rather boring.

So I'll use David's method. David hasn't shaved with Ockam's Razor for
years!

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research




--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Resolution
Next Topic: Re: IDL .SAV cross-platform problem

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

Current Time: Fri Oct 10 03:12:04 PDT 2025

Total time taken to generate the page: 0.00619 seconds