def mask_to_bin(mask): new = np.array(mask,tuple) print(new) for i in range(len(new)/pixel_size): new[i] = pix.mult_by_const(new[i],1./255)