Chipp's alphatest revisited

Chipp Walters chipp at chipp.com
Mon Jan 26 02:10:54 EST 2004


Unfortunately, maskImage is only 1 bit deep, whereas alphadata is 8 bits. As
such, it won't work with any of my existing image manipulation libraries...
I pretty much need Tuviah to fix this (or post a work-around).

> 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
>    put binaryEncode("C",0) into transparentPixel
>    ### fiddle with this value
>    put binaryEncode("C",100) 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list