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

Home » Public Forums » archive » Re: write_GIF, PNG: incomplete palette
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: write_GIF, PNG: incomplete palette [message #33306] Mon, 16 December 2002 11:02
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Streun Andreas (andreas.streun@psi.ch) writes:

> when writing PNGs (or GIFs in IDL<5.4) I don't get
> the full 256 color palette but only something like
> 69 colors. As far as I know GIFs can have up to 256
> colors. Any idea what's the problem?

There are several things that can be going wrong.
Just a glance at your code shows TVRD() calls and no
DEVICE, DECOMPOSED calls, so that is enormously
suspicious.

Have you tried my TVREAD procedure? If that doesn't
produce correct PNG and GIF files, then we *know*
something is wrong. :-)

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

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: write_GIF, PNG: incomplete palette [message #33307 is a reply to message #33306] Mon, 16 December 2002 10:36 Go to previous message
wmconnolley is currently offline  wmconnolley
Messages: 106
Registered: November 2000
Senior Member
Streun Andreas <andreas.streun@psi.ch> wrote:
> when writing PNGs (or GIFs in IDL<5.4) I don't get
> the full 256 color palette but only something like
> 69 colors. As far as I know GIFs can have up to 256
> colors. Any idea what's the problem?

I write png's OK with a 256 colour table.

Are you sure you colour table *does* have 256 colours? If opened on an 8-bit
display with other apps running, you'll probably get fewer.

DF's pages will point you to the truth.

Try: print,!d.n_colors

If that doesn't give you 256 colours, you need a private colour map: try:

begin window,0,retain=2,col=256,/pix & wdelete,0

as your very first IDL command.

-W.

--
William M Connolley | wmc@bas.ac.uk | http://www.nerc-bas.ac.uk/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
I'm a .signature virus! copy me into your .signature file & help me spread!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Illegal 3D Transformation (Beginner)
Next Topic: Re: Illegal 3D Transformation (Beginner)

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

Current Time: Wed Oct 08 18:38:28 PDT 2025

Total time taken to generate the page: 0.00582 seconds