Skip to content

Instantly share code, notes, and snippets.

View alyti's full-sized avatar
🏳️‍⚧️

Alyssa alyti

🏳️‍⚧️
View GitHub Profile
#!/usr/bin/python3
# Solution to the challenge at https://gist.github.com/ehmo/7f515ac6461c1c4d3e5a74f12e6eb5ea
#
# Given an input base image, computes two derivative images that have different
# perceptual hashes, yet differ by only one pixel.
#
# Usage: hash_bisector.py <input.png> <output_a.png> <output_b.png>
import sys, imagehash
from PIL import Image, ImageEnhance