Splitting JPEG files into RGB components [message #21094] |
Wed, 09 August 2000 00:00 |
Dana Purton
Messages: 1 Registered: August 2000
|
Junior Member |
|
|
I am attempting to read a JPEG file into IDL and then split it into the
three colour
components so that each component can be analysed separately. I have
been
able to read it in and display it on the screen but am finding it
difficult to separate it into its red,green,blue components. Is this at
all possible with JPEG compression, and if so can anyone give me ome
hints on how to go about it?
Thanks,
Dana
|
|
|
Re: Splitting JPEG files into RGB components [message #21095 is a reply to message #21094] |
Tue, 08 August 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Dana Purton (dpurton@utas.edu.au) writes:
> I am attempting to read a JPEG file into IDL and then split it into the
> three colour
> components so that each component can be analysed separately. I have
> been
> able to read it in and display it on the screen but am finding it
> difficult to separate it into its red,green,blue components. Is this at
> all possible with JPEG compression, and if so can anyone give me ome
> hints on how to go about it?
Assuming you read the JPEG image into IDL like this:
READ_JPEG, myfile, image, True=3
You can get the RGB components like this:
red = image[*,*,0]
green = image[*,*,1]
blue = image[*,*,2]
Here is a case where you *want* that single dimension
to disappear. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|