I\'m trying to implement an image blending algorithm that receives two images im1, im2 and a binary mask and blends the two image accroding to that mask. I\'m using the foll