This dense script can generate and perform operations on image files.
The program can generate color or black-and-white images of any size.
usage: "Image Magic.py" gen [-h] [-c] x y Output
A 400x300 png image of random pixels:
The program can perform a bitwise AND, OR, or XOR operation on two input images.
usage: "Image Magic.py" op [-h] [-o Output] File1 operation File2
But why would anyone in their right mind ever perform an XOR on two images? Well, to encrypt an image with a secret seed!
Unencrypted image:
Now let's perform an XOR on this image and the previous random image!
python "Image Magic.py" op -o output.png logo.png xor random.png
Without knowing the random seed used to generate the key image, it is nearly impossible to reverse this process to recover the original image.