Image Masks - Completely lost

Scott Rossi scott at tactilemedia.com
Tue Dec 27 17:35:47 EST 2005


Recently, Bob Warren wrote:

> I am trying to apply a mask to an image without any success whatsoever
> in getting it to work correctly. Would someone be kind enough to give me
> an example of how it might be done? My experiments with "imagedata" and
> "alphadata" have so far failed.
> ...
> Any hints regarding file types that can be used (e.g. PNG, JPG, BMP,
> etc.), the richness of bits (e.g. 2-bit, 8-bit, 16-bit, 32-bit, etc.)
> and so on, for the original coloured picture and the mask picture, would
> be greatly appreciated.

For variable translucency masks, use 24 bit PNG images.  For 1 bit (on/off)
masks, you can use 8 bit PNG or GIF.

To apply a mask to an image, you can set the alphaData of one image to the
alphaData of another.  You cannot (as far as I know) apply imageData as the
alphaData of an image without conversion (results in a crash here).  To
change image/alphaData via script, you must work with binary values -- see
below.


> Also, can anyone recommend useful webpages elucidating this kind of thing?

Ken Ray's site:

  <http://www.sonsothunder.com/devres/revolution/tips/imag003.htm>

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list