import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
def highlight_watermark(pixel_data:np.array, divisor_key:int) -> np.array:
'''Returns a numpy array with pixels divisible by divisor_key in black and all others in white'''
highlighted_image = pixel_data.copy()
watermark = np.where(np.mod(pixel_data, divisor_key) != 0)
not_watermark = np.where(np.mod(pixel_data, divisor_key) == 0)
highlighted_image[watermark] = 255
highlighted_image[not_watermark] = 0
return highlighted_image
if __name__ == "__main__":
pixel_data = np.array(img.imread("src/invite.bmp"))
hidden_watermark = highlight_watermark(pixel_data, 3)
plt.imshow(hidden_watermark)
plt.savefig("flag.png")
'''
The watermark shows a set of coordinates 22.444N, 74.220W.
Typing these into Google Maps will reveal the location of the party, Rick Roll Island
'''