(input_img, mask_img)
return black
Applies a mask over an image
    Both |input_img| and |mask_img| should be opened PIL Image
Applies a mask over an image
    Both |input_img| and |mask_img| should be opened PIL Image
Applies a mask over an image Both |input_img| and |mask_img| should be opened PIL Image
def applyMask(input_img, mask_img):
    """Applies a mask over an image
    Both |input_img| and |mask_img| should be opened PIL Image
    """

    black = Image.new(input_img.mode, input_img.size) # Creating a new image with the default black background
    mask = mask_img.convert("1") # transform mask image to black and white
    mask = mask.resize(input_img.size, Image.BICUBIC) #Adjust to input size
    black.paste(input_img, mask=mask)
    return black
def applyMask ( input_img , mask_img ) : black = Image . new ( input_img . mode , input_img . size ) # Creating a new image with the default black background mask = mask_img . convert ( "1" ) # transform mask image to black and white mask = mask . resize ( input_img . size , Image . BICUBIC ) #Adjust to input size black . paste ( input_img , mask = mask ) return black