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

Home » Public Forums » archive » 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
write_GIF, PNG: incomplete palette [message #33311] Mon, 16 December 2002 09:46
Streun Andreas is currently offline  Streun Andreas
Messages: 4
Registered: October 2000
Junior Member
Hi there,

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?

Thanks and best regards,

Andreas Streun

;----------------------------------

; define a colortable: black,blue>>>grey>>>red,white:
; (colortable is ok, checked by xpalette, xloadct)

rvec=bytarr(256) & gvec=rvec & bvec=rvec
index=bindgen(127)+1
gvec=[0, index, 128-index,255]
bvec=[0,255-index, 128-index,255]
rvec=[0, index, 127+index,255]

; set the colortable:

tvlct, rvec, gvec, bvec

;... plot something.....

;read the display and write it to png (or gif):

write_png, pngfile, tvrd(), rvec, gvec, bvec

; png or gif files show the image, but the colors are only
; a subset of my table, seem to come from the upper half only:-(


--
Dr. Andreas Streun
Paul Scherrer Institute, WSLA/106
CH-5232 Villigen PSI, Switzerland
Tel/Fax: ++41 (56) 310 3688/3151
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: volume rendering: emphasizing material boundaries
Next Topic: Illegal 3D Transformation (Beginner)

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

Current Time: Wed Oct 08 14:33:26 PDT 2025

Total time taken to generate the page: 0.00478 seconds