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

Home » Public Forums » archive » Re: transparent GIF pixels
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
Re: transparent GIF pixels [message #21142] Thu, 10 August 2000 00:00
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kenneth Mankoff <mankoff@lasp.colorado.edu> writes:
>
> I'm using ION to make images for a website. ION is "IDL On [the] Net"
>
> For those of you who know html, its really as simple as this to generate
> images:
>
> <html>
> <ion_img>
> <idl>
> ;;; idl code goes here
> </idl>
> </ion_img>
> </html>
>
> and *wow*, you have a gif or jpeg _inside_ your web page that is generated
> based upon inputs supplied to the page by the user.
>
> But, yes, GIF's can have pixels that are transparent in that they show the
> background through them. WRITE_PNG has a transparent option, so i could
> write a PNG with transparent pixels, then re-read it the NEXT command
> (this stupid and slow), and then display that image to the page, and have
> my transparent (see-through) pixels.
>
> But i would prefer to do all that in memory, rather than using the
> webserver to needlessly read/write to PNG image.

I hear you Ken. I am a little surprised that ION doesn't have any
more web-friendly functionality than straight IDL does
(e.g. transparent gifs).

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: transparent GIF pixels [message #21145 is a reply to message #21142] Thu, 10 August 2000 00:00 Go to previous message
Kenneth Mankoff is currently offline  Kenneth Mankoff
Messages: 42
Registered: August 1999
Member
On 10 Aug 2000, Craig Markwardt wrote:
> davidf@dfanning.com (David Fanning) writes:
>
>> Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:
>>
>>> David, I think he's talking specifically about GIF transparent pixels.
>>> I understand that you can reserve one GIF color to be transparent, so
>>> to speak. Any pixels with that color are not rendered, so any
>>> background graphics can show through. This can be especially useful
>>> in web programming. I don't think he's actually trying to render it
>>> on the screen himself.
>>
>> I'm not so sure. But I admit "I would like to make them transparent
>> while the image is in memory." could be open to interpretation.
>> I thought he wanted to see transparent pixels in IDL. Why else would
>> he be saving and reading them back?
>
> I think he said he wanted to *avoid* writing and then reading back.
> Other than that let's keep agreeing.
>
> Craig

I'm using ION to make images for a website. ION is "IDL On [the] Net"

For those of you who know html, its really as simple as this to generate
images:

<html>
<ion_img>
<idl>
;;; idl code goes here
</idl>
</ion_img>
</html>

and *wow*, you have a gif or jpeg _inside_ your web page that is generated
based upon inputs supplied to the page by the user.

But, yes, GIF's can have pixels that are transparent in that they show the
background through them. WRITE_PNG has a transparent option, so i could
write a PNG with transparent pixels, then re-read it the NEXT command
(this stupid and slow), and then display that image to the page, and have
my transparent (see-through) pixels.

But i would prefer to do all that in memory, rather than using the
webserver to needlessly read/write to PNG image.

-ken.
Re: transparent GIF pixels [message #21151 is a reply to message #21142] Thu, 10 August 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
davidf@dfanning.com (David Fanning) writes:

> Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:
>
>> David, I think he's talking specifically about GIF transparent pixels.
>> I understand that you can reserve one GIF color to be transparent, so
>> to speak. Any pixels with that color are not rendered, so any
>> background graphics can show through. This can be especially useful
>> in web programming. I don't think he's actually trying to render it
>> on the screen himself.
>
> I'm not so sure. But I admit "I would like to make them transparent
> while the image is in memory." could be open to interpretation.
> I thought he wanted to see transparent pixels in IDL. Why else would
> he be saving and reading them back?

I think he said he wanted to *avoid* writing and then reading back.
Other than that let's keep agreeing.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: transparent GIF pixels [message #21153 is a reply to message #21142] Thu, 10 August 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Craig Markwardt (craigmnet@cow.physics.wisc.edu) writes:

> David, I think he's talking specifically about GIF transparent pixels.
> I understand that you can reserve one GIF color to be transparent, so
> to speak. Any pixels with that color are not rendered, so any
> background graphics can show through. This can be especially useful
> in web programming. I don't think he's actually trying to render it
> on the screen himself.

I'm not so sure. But I admit "I would like to make them transparent
while the image is in memory." could be open to interpretation.
I thought he wanted to see transparent pixels in IDL. Why else would
he be saving and reading them back?

> Unfortunately, the answer to the question appears to be that there is
> no way to assign transparent GIF pixels in IDL. There are no options
> to WRITE_GIF that would satisfy this requirement.

Craig, we found something today you and I agree on 100%! It's going
to be a good day, I can feel it. :-)

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
Re: transparent GIF pixels [message #21155 is a reply to message #21142] Thu, 10 August 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
davidf@dfanning.com (David Fanning) writes:

> Kenneth Mankoff (mankoff@lasp.colorado.edu) writes:
>
>> Is it possible to create transparent pixels?
>>
>> It appears from the help that you can, but only when you write png's to
>> disk. I have tried this and have been unsuccessful.
>>
>> Anyways, i want to do it in a situation where i don't write and immediatly
>> read just to get my transparencies. I would like to make them transparent
>> while the image is in memory. And i would prefer gifs, not png's.
>>
>> thanks for any clues or pointers.
>
> I'd try something like this with a 2D image:
>
... deletia ...

David, I think he's talking specifically about GIF transparent pixels.
I understand that you can reserve one GIF color to be transparent, so
to speak. Any pixels with that color are not rendered, so any
background graphics can show through. This can be especially useful
in web programming. I don't think he's actually trying to render it
on the screen himself.

Unfortunately, the answer to the question appears to be that there is
no way to assign transparent GIF pixels in IDL. There are no options
to WRITE_GIF that would satisfy this requirement.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: transparent GIF pixels [message #21160 is a reply to message #21142] Thu, 10 August 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Kenneth Mankoff (mankoff@lasp.colorado.edu) writes:

> Is it possible to create transparent pixels?
>
> It appears from the help that you can, but only when you write png's to
> disk. I have tried this and have been unsuccessful.
>
> Anyways, i want to do it in a situation where i don't write and immediatly
> read just to get my transparencies. I would like to make them transparent
> while the image is in memory. And i would prefer gifs, not png's.
>
> thanks for any clues or pointers.

I'd try something like this with a 2D image:

transparentPixelValue = 100
indices = Where(image EQ transparentPixelValue, count)
IF count GT 0 THEN image[indices] = !P.Background
TV, image

Should work like a charm. :-)

If you mean transparent in the sense that you can
see through to something underneath the image (beside
the background), then you will have to do something
similar to this in the Z-graphics buffer with Polyfill.

And I should imagine there would be several object
graphics solutions too, should you need them.

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: No. of variables allowed?
Next Topic: Re: Dynamic menus on base widget using MBAR

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

Current Time: Fri Oct 10 16:30:16 PDT 2025

Total time taken to generate the page: 0.56015 seconds