def mask(self,image):
"""Uses the image passed as parameter as alpha mask."""
if npy:
aux1 = numpy.bitwise_and(self.pixels,0xffffff)
aux2 = numpy.bitwise_and(image.pixels,0xff000000)
self.pixels = numpy.bitwise_or(aux1,aux2)
return
for i in range(self.width):
for j in range(self.height):
n = self.get(i,j)
m = image.get(i,j)
new = ((m & 0xff000000) << 24) | (n & 0xffffff)
self.set(i,j,new)
评论列表
文章目录