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

Home » Public Forums » archive » IDLgrImage and the channel keyword
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
IDLgrImage and the channel keyword [message #90167] Wed, 04 February 2015 13:02 Go to next message
ronn kling[1] is currently offline  ronn kling[1]
Messages: 16
Registered: March 2014
Junior Member
All,

Has anyone figured out how to use the channel keyword for IDLgrImage?

If you try this

file = 'E:\Program Files\Exelis\IDL84\examples\data\rose.jpg'
im = read_image(file)
xobjview, obj_new('IDLgrImage',im, channel='ff0000'x)

What I expect to see is a red channel image, but instead I see cyan which is a combination of green and blue. So it is almost acting like a color subtraction. But if you try other hex combinations they don't work like subtractions either.

Any ideas????

Ronn Kling
Re: IDLgrImage and the channel keyword [message #90168 is a reply to message #90167] Wed, 04 February 2015 15:53 Go to previous messageGo to next message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Wednesday, February 4, 2015 at 2:02:30 PM UTC-7, ronn kling wrote:
> All,
>
> Has anyone figured out how to use the channel keyword for IDLgrImage?
>
> If you try this
>
> file = 'E:\Program Files\Exelis\IDL84\examples\data\rose.jpg'
> im = read_image(file)
> xobjview, obj_new('IDLgrImage',im, channel='ff0000'x)
>
> What I expect to see is a red channel image, but instead I see cyan which is a combination of green and blue. So it is almost acting like a color subtraction. But if you try other hex combinations they don't work like subtractions either.
>
> Any ideas????
>
> Ronn Kling

Good question! It doesn't produce what I would expect from the documentation setting just the red channel in an RGB input image:

IDL> a = bytarr(3, 255, 255)
IDL> a[0, *, *] = 255B
IDL> xobjview, idlgrimage(a, channel = 'ff0000'x)
IDL> xobjview, idlgrimage(a, channel = '00ff00'x)
IDL> xobjview, idlgrimage(a, channel = '0000ff'x)

Compare with

IDL> xobjview, idlgrimage(a, channel = '000101'x)

Is Karl still out here on the internets?
Re: IDLgrImage and the channel keyword [message #90169 is a reply to message #90168] Wed, 04 February 2015 16:29 Go to previous messageGo to next message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Wednesday, 4 February 2015 15:53:14 UTC-8, Jim P wrote:
> On Wednesday, February 4, 2015 at 2:02:30 PM UTC-7, ronn kling wrote:
>> All,
>>
>> Has anyone figured out how to use the channel keyword for IDLgrImage?
>>
>> If you try this
>>
>> file = 'E:\Program Files\Exelis\IDL84\examples\data\rose.jpg'
>> im = read_image(file)
>> xobjview, obj_new('IDLgrImage',im, channel='ff0000'x)
>>
>> What I expect to see is a red channel image, but instead I see cyan which is a combination of green and blue. So it is almost acting like a color subtraction. But if you try other hex combinations they don't work like subtractions either.
>>
>> Any ideas????
>>
>> Ronn Kling
>
> Good question! It doesn't produce what I would expect from the documentation setting just the red channel in an RGB input image:
>
> IDL> a = bytarr(3, 255, 255)
> IDL> a[0, *, *] = 255B
> IDL> xobjview, idlgrimage(a, channel = 'ff0000'x)
> IDL> xobjview, idlgrimage(a, channel = '00ff00'x)
> IDL> xobjview, idlgrimage(a, channel = '0000ff'x)
>
> Compare with
>
> IDL> xobjview, idlgrimage(a, channel = '000101'x)
>
> Is Karl still out here on the internets?

Or perhaps Don J Lindler who, 14 years ago, claimed to have been "able to use IDLgrImage objects with the channel set ('ff0000'x for red, '00ff00'x for green, and '0000ff',x for blue).":

https://groups.google.com/forum/#!searchin/comp.lang.idl-pvw ave/IDLgrImage$20channel/comp.lang.idl-pvwave/j9LozjSkkFQ/9B e5T_DCTzcJ

:-)

FWIW, how it looks to me is indeed "subtractive colour" handling... note that if you pass '000000'X what you get is the white background, not a black image, so perhaps '000001'X means to add a blue subtracting filter only: where B in the RGB image is high, it passes blue (along with full, unfiltered red and green, giving white), and where B is low, only blue is lowered (again, along with full, unfiltered red and green, giving yellow)

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
Re: IDLgrImage and the channel keyword [message #90573 is a reply to message #90169] Wed, 11 March 2015 03:16 Go to previous message
ronn kling[1] is currently offline  ronn kling[1]
Messages: 16
Registered: March 2014
Junior Member
Tech support finally figured out what was happening here, and I am adding it to this post for future reference. The reason that it looked like subtractive color handling was due to my view background being white ([255,255,255]). It was this color that was being "OR'd" with the channel. All you have to do to get the correct behavior is to change the background color to black!!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Locking graphics in GUI / disable resize, rotate or translate
Next Topic: Image Subset

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

Current Time: Wed Oct 08 09:15:11 PDT 2025

Total time taken to generate the page: 0.00484 seconds