[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: transparent GIF pixels
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