write_GIF, PNG: incomplete palette [message #33311] |
Mon, 16 December 2002 09:46 |
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
|
|
|