Skip to content

Instantly share code, notes, and snippets.

@stephanie-w
Created April 6, 2021 18:16
Show Gist options
  • Select an option

  • Save stephanie-w/d7d9625874cce6e16f6c6a2f3141a1f8 to your computer and use it in GitHub Desktop.

Select an option

Save stephanie-w/d7d9625874cce6e16f6c6a2f3141a1f8 to your computer and use it in GitHub Desktop.
from PIL import Image
import numpy as np
secret = Image.open("cover-secret.png")
data_s = np.array(secret)
bit = np.bitwise_and(np.right_shift(data_s, 1), 1)
data_s = bit ^ data_s & 1
new_img = Image.fromarray(data_s * np.uint(255))
new_img.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment