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

Home » Public Forums » archive » Re: Working with color, cursor, and png to extract information
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: Working with color, cursor, and png to extract information [message #58522] Mon, 04 February 2008 12:31 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian Larsen writes:

> What I want to do:
> - Start with a png image from old research (like
> http://www.dfanning.com/programs/docs/read_toms_aerosol.jpg)
> - read in the png (yes I know the example is a jpg, but it should be
> the same procedure)
> - extract the "value" at each pixel in the image based on the colorbar

The problem is that this image is not a reflection of "values",
it is a reflection of colors used to represent those values.
And those colors are not built into the palette, which as you
see is just strictly gray scale, but into the fabric of the
image itself. This is not the kind of image you can do science
with, I guess is what I am saying.

An image is encoded with a scheme that can represent 16.7 million
colors. A color table typically contains 256 colors. But, *which*
256!? Obviously, there is no one-to-one relationship.


Suppose you do a statistical analysis and find that out of
the 16.7 million possible triples, you only have 16 in your
image, representing 16 colors. You still don't know the foggiest
thing about the *values* those colors represent, unless you
have information you are not sharing with us. That is to say,
the "meaning" of those color triples is not encoded in the image
in any way. Presumably when you look for a "value", you are looking
for a physically meaningful number. There are no such numbers in
a 24-bit image.

Cheers,

David
--
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.")
Re: Working with color, cursor, and png to extract information [message #58620 is a reply to message #58522] Mon, 04 February 2008 13:43 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> The problem is that this image is not a reflection of "values",
> it is a reflection of colors used to represent those values.
> And those colors are not built into the palette, which as you
> see is just strictly gray scale, but into the fabric of the
> image itself. This is not the kind of image you can do science
> with, I guess is what I am saying.
>
> An image is encoded with a scheme that can represent 16.7 million
> colors. A color table typically contains 256 colors. But, *which*
> 256!? Obviously, there is no one-to-one relationship.
>
> Suppose you do a statistical analysis and find that out of
> the 16.7 million possible triples, you only have 16 in your
> image, representing 16 colors. You still don't know the foggiest
> thing about the *values* those colors represent, unless you
> have information you are not sharing with us. That is to say,
> the "meaning" of those color triples is not encoded in the image
> in any way. Presumably when you look for a "value", you are looking
> for a physically meaningful number. There are no such numbers in
> a 24-bit image.

David,

I am not sure I agree with you entirely on this, if it were as
hopeless as you say then why do we make those plots, our eyes can
obviously decode the "meaning" in the color. Since you have the
colorbar, it seems that gives a one-to-one mapping of colors to data
value. At the worst case maybe just at the points in the colorbar
where you have the value.

If I ask the question another way does it make more sense? How can
one choose out of an image a particular color and then display that?
For example in that aerosol image of yours say I wanted to know where
the data was between 3 and 3.5 (red), I can presumably "select" red
and then pull out the red pixels from the image? No? Is this as easy
as the 3 elements in image[*,0, 0] and a where statement? I am not
too clear on exactly how the colors are built.

Cheers,



Brian

------------------------------------------------------------ -------------
Brian Larsen
Boston University
Center for Space Physics
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idlwave: spaces round = and other operators
Next Topic: Working with color, cursor, and png to extract information

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

Current Time: Wed Oct 08 15:12:05 PDT 2025

Total time taken to generate the page: 0.00665 seconds