Re: write_GIF, PNG: incomplete palette [message #33306] |
Mon, 16 December 2002 11:02 |
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  |
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!
|
|
|