Chipp's alphatest revisited

Wouter wouter.abraham at pi.be
Sat Jan 24 10:08:06 EST 2004


Small change in the code produces better results.

On 24 Jan 2004, at 15:46, Wouter wrote:

>
> Hi,
>
> May be this can be a starter for a possible workaround (until the set 
> alphaData bug gets solved).
> Compute a maskdata from the alphaData of the GoodAlpha image.
> It is not perfect because it does not retain the cast shadow set by 
> the alphadata.
> But the cast shadow can be simulated in other ways if it is only to be 
> used on OS X
>
> Set the script of the "set alphadata ->" button to:
>
> on mouseUp

    set the casesensitive to true

>   put binaryEncode("C",0) into transparentPixel
>   ### fiddle with this value

      put binaryEncode("C",70) into opaquePixel

>   put the imagedata of img "prep" into iData
>   put the alphaData of img "prep2" into aData
>   repeat for each char i in aData
>    if i > opaquePixel then
>       put opaquePixel after mData
>     else
>       put  transparentPixel after mData
>     end if
>   end repeat
>   set the imagedata of img "prep" to iData
>   set the maskdata of img "prep" to mData
> end mouseUp
>
> (be sure to do the 1 pixel trick or the export to png to retain the 
> image)
>
> Greetings,
> WA
>



More information about the use-livecode mailing list