0 Replies Latest reply on Jan 7, 2011 3:16 PM by srihards

    How to use copyPixels and mask some places?

    srihards Level 1

      I've two images with the same size (49 x 90), they both are 8-bit depth. The first image has a purple backgroud color, the other one has a background color rgb(0, 255, 0) which is true green.

      The first image has a pixel doll with huge hair on her head, the other one has a drawing of pretty small hat around which I've some space filled with red color. The idea is two place the hat image over the doll with huge hair image with copyPixels method, make the background of hat image transparent while copying and use the red filled places as a mask so that after copying the hat would be on the dolls head and the hair which is going out of the hat, if you understand what i mean, is hidden so that it would look that doll has her hair in the hat. Get the idea?

       

      member("two").image.copyPixels(member("one").image, member("one").rect, member("one").rect, [#bgcolor: rgb(0, 255, 0) , #ink: 36])

       

      I got it this far that the background is transparent, but I the mask and matte stuff just doesn't make any sense to me. I can't figure out how to make the red filled places works as a mask to hide the hair after copying. Any help?