else:
fatal_error("Mask Color " + str(mask_color) + " is not "white" or "black"!")
array_data = rgb_img.copy()
// Mask the array
array_data[np.where(mask == 0)] = color_val
// Check if the array data is
if params.debug == "print":
print_image(array_data, os.path.join(params.debug_outdir, str(params.device) + "_masked.png"))
elif params.debug == "plot":
plot_image(array_data)
return array_data