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

Home » Public Forums » archive » how IDL or ION returns an alpha image (32 bits)
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
how IDL or ION returns an alpha image (32 bits) [message #55597] Fri, 31 August 2007 13:41 Go to next message
aleks.franca@gmail.co is currently offline  aleks.franca@gmail.co
Messages: 33
Registered: March 2007
Member
Hy all!!
I'm having a hard time with this problem about alpha channel. I wish
someone with experience in it could help me.
I need to generate an image with transparency. This image will be used
on top of other image in another application out of idl. It's a web
application. I based on 2 routines from idl examples that work with
alpha and process images in IDL: "alphacomposite_doc.pro", and
"alphaimage_obj.pro". I need to have the image with the alpha channel
on the OUTPUT. Is this possible??

Any help would be appreciated

Aleksander
Re: how IDL or ION returns an alpha image (32 bits) [message #55708 is a reply to message #55597] Tue, 04 September 2007 13:13 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
I don't think you can do this directly in ION script. While individual
objects in the ION_SCRIPT_BUFFER might contain alpha channels, *I think*
the image is "flattened" as it is rendered and output as ION_IMAGE.
This seems to be the case with any rendered OG output as the IDLgrWindow
and IDLgrBuffer Read methods only return 3xNxM arrays. (I smell a
feature request)

You can do it in IDL using WRITE_PNG. The documentation is a bit vague
on this, but at least with 6.4 WRITE_PNG you can create RGBA images.
Ignore the TRANSPARENT keyword as this is meant for binary transparency
with 8-bit images. Just write a 4xNxM array as shown in the example
code. Because you can't render to an RGBA image, you'll have to do all
of the compositing yourself if you have more than one image.

If you need to do this in ION Script, you can have IDL generate a
temporary .png file using WRITE_PNG and you can insert that in to your
generated page. When I did this I had to do it the hard way, generating
the file and then dealing with cleaning it up. ION Script may have some
functions that make this easier now.

-Rick


aleks.franca@ wrote:
> Hy all!!
> I'm having a hard time with this problem about alpha channel. I wish
> someone with experience in it could help me.
> I need to generate an image with transparency. This image will be used
> on top of other image in another application out of idl. It's a web
> application. I based on 2 routines from idl examples that work with
> alpha and process images in IDL: "alphacomposite_doc.pro", and
> "alphaimage_obj.pro". I need to have the image with the alpha channel
> on the OUTPUT. Is this possible??
>
> Any help would be appreciated
>
> Aleksander
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Bug in IDL's FILE_INFO function
Next Topic: Indexing problem.. Please help me out!!!

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

Current Time: Wed Oct 08 19:51:28 PDT 2025

Total time taken to generate the page: 0.00637 seconds