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

Home » Public Forums » archive » Understanding Color in IDL
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: Understanding Color in IDL [message #50711 is a reply to message #50552] Thu, 12 October 2006 02:09 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Wed, 11 Oct 2006, David Fanning wrote:

> Folks,
>
> A quick look at my web page statistics for the keywords people
> use to find my pages convinces me that understanding how color
> works in IDL is still the number one problem for new users.
> (Closely followed by how to get decent PostScript output and
> how to calculate the log base 2 of a number, apparently.)
>
> I've written a number of articles on color over the years,
> but I've never collected this material into a single
> coherent explanation. I've attempted to do that now with
> a chapter I've written for the 3rd edition of my book.
> (Please don't hold your breath, but I *am* working on it,
> off and on.)
>
> I've made the chapter available as a PDF file for
> those who might be interested. If you are still confused
> after reading it, please let me know. I'd like to get
> this right before the book is published. :-)
>
> You can find a link to the PDF file here:
>
> http://www.dfanning.com/color_tips/colorchp3.html
>
> Cheers,
>
> David
>
> P.S. Actually, the number one way people come to my web page
> is searching the Google image archives for "pretty girl oktoberfest",
> but I don't want to get into the reasons behind that!
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>


Hi David,

what I miss is a summary table for quick reference. Here is what I use for
FL, on all platforms and for all devices (X, WIN, PS, PDF, Z):

============================================================ ==============

C = color (0...2^24-1)
c = C mod 256 (0...255)

r = red component of C (0...255) = C mod 256
g = green component of C (0...255) = C / 256 mod 256
b = blue component of C (0...255) = C / 256 / 256

R = lookup table for red (256 element vector)
G = lookup table for green (256 element vector)
B = lookup table for blue (256 element vector)


R,G,B for R,G,B for
decomposed=1 decomposed=0

24 bit image r, g, b R[r], G[g], B[b]

8 bit image c, c, c R[c], G[c], B[c]

lines, text, etc. R[r], G[g], B[b] R[c], G[c], B[c]

============================================================ ==============

It slightly differs from IDL behaviour. Also note the R[r], G[g], B[b]
values, which are decomposed and indexed at the same time (these values
differ from r, g, b only if a non-linear lookup table is used).

regards,
lajos

ps: probably I will change the 'lines with decomposed=1' mode to omit
table lookup, to be compatible with IDL.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Understanding Color in IDL
Next Topic: difference between icontour and contour?

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

Current Time: Tue Dec 02 20:25:39 PST 2025

Total time taken to generate the page: 1.67477 seconds