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

Home » Public Forums » archive » Re: BGR color instead of RGB
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
Re: BGR color instead of RGB [message #41798] Tue, 07 December 2004 06:12 Go to next message
war is currently offline  war
Messages: 21
Registered: December 2003
Junior Member
Hi again,

Dave, you are just great. Thanks for the quick reply.

The reason I thought it was backward is that when looking at, say, html
color, the red one is defined by the code #FF0000, so I just assumed it
is the same.

Andry
Re: BGR color instead of RGB [message #41849 is a reply to message #41798] Tue, 07 December 2004 06:12 Go to previous message
war is currently offline  war
Messages: 21
Registered: December 2003
Junior Member
Hi again,

Dave, you are just great. Thanks for the quick reply.

The reason I thought it was backward is that when looking at, say, html
color, the red one is defined by the code #FF0000, so I just assumed it
is the same.

Andry
Re: BGR color instead of RGB [message #41850 is a reply to message #41798] Tue, 07 December 2004 05:51 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andry William writes:

> I have been looking on the group about a problem I am having with the
> color.
> This seems to be something a lot of people have already experienced
> but I am not sure I found the solution on how to solve it.
>
> Our group is thinking of buying IDL 6.1 so I am trying to test it on
> our system.
>
> I do a plot using
>
> PLOT, randomu(n,20), color='ff0000'x, background='ffffff'x
>
> it just comes out with a blue color (instead of red). It seems like it
> uses BGR
> table rather than RGB.
>
> I appreciate any input on understanding how I can get the right color
> (I mean, the usual RGB color). What startup or configuration should I
> use.

I think this is the right color. Perhaps it's *you* who is
thinking backwards. In a 24-bit number, the lowest 8 bits
specify red, the middle 8 bits specify green, and the
highest 8 bits specify blue.

IDL> Print, Binary('ff0000'xL)

1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Where the low bits are on the right, as in most numbers.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: test for ENVI running in IDL code
Next Topic: Re: reading images with small # pixels but large # bands in ENVI

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

Current Time: Thu Oct 09 20:51:28 PDT 2025

Total time taken to generate the page: 0.24099 seconds