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

Home » Public Forums » archive » Splitting JPEG files into RGB components
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
Splitting JPEG files into RGB components [message #21094] Wed, 09 August 2000 00:00
Dana Purton is currently offline  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 Go to previous message
davidf is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Cell boundary program?
Next Topic: A related question...

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

Current Time: Wed Oct 08 16:03:55 PDT 2025

Total time taken to generate the page: 0.00507 seconds