| 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  |
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
>
|
|
|
|