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

Home » Public Forums » archive » Re: color_quan & gif files
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: color_quan & gif files [message #16487] Thu, 29 July 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Simon Hall wrote:
> I'm producing a lot of images that will eventually end up on a web
> page, so I'm generating .gif files. I'm also using a 24 bit display
> so my code is something like this:
>
> set_plot, 'win'
> device, decomposed = 0
>
> <do plot here>
>
> tvlct, r, g, b, /get
> write_gif, filename, color_quan(tvrd(/true), 1, r, g, b), r, g, b
>
> (All this courtesy of dfanning.com, thanks David)
>
> I do get valid gif files but color_quan seems to alter the colours a
> little. Most noticably, the white background is now light grey
> ([248,248,248] rather than [255,255,255]). Not a big difference but
> immediately obvious against a white background.

Here's a hack which changes any color table entries with R,G,B values
greater than 245 to white:

image = color_quan(tvrd(/true), 1, r, g, b, colors=256)

value = 245
index = where((r gt value) and (g gt value) and (b gt value), count)
if count gt 0 then begin
r[index] = 255B
g[index] = 255B
b[index] = 255B
endif

write_gif, filename, image, r, g, b

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Previous Topic: saving a linked list to file ?
Next Topic: Re: IDL to C compiler?

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

Current Time: Sat Oct 11 03:41:43 PDT 2025

Total time taken to generate the page: 1.36058 seconds