[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: transparent GIF pixels



We have been playing around with ION for a few months now.  Although the
constraints of ION can be frustrating, I think you can do what you need
to.  You may just not want to!

Use the <ION_DATA_OUT> tag and write the .png file to a temp directory. 
The temp directory will have to be writable by your web server's
process.  There may be some security issues here (someone could hammer
your ION server and fill up the tmp area) but I am not a specialist in
these matters.  Generate a name for the file in IDL using random
numbers.  I have done it like so:

filename='images/tmp/ion'+string(fix(10000.*randomu(s)),format='(I5.5)')+'.png'

write the png.

Then use some print statements to insert some html code to link to this
image.  

Lastly, issue a command to at to clean up your image:

spawn, 'echo "rm -f /www/'+filename+'" | at now + 3 minutes'


this is certainly not as clean as one would like but it works well.  We
have asked the ION engineers to add the ability to send VRML files
directly (via ion.i) instead of using this approach and they were quite
interested in the idea.  I would pass along your suggestion of adding a
keyword to the <ION_IMAGE> tag that would allow for at least transparent
png's.  My take on it is that they have this product that it quite
immature and they are eager to hear about peoples experiences.


-Rick Towler



Kenneth Mankoff wrote:
> 
> 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.