Split image into tiles and scramble/unscramble them based on a seed. The demo application can be found at https://image-scramble.herokuapp.com.
Using scramble mode on this sample image will produce the following output:
To revert the image to its original state, use the same seed
and slice_size
on unscramble mode.
-
Pycasso is a Python version of webcaetano/image-scramble and webcaetano/shuffle-seed. This also uses a stripped-down port of davidbau/seedrandom to initialize the PRNG.
-
Sample image is taken from Pepper&Carrot by David Revoy licensed under CC BY 4.0.
$ pip install image-scramble
- First, you should get a copy of this project in your local machine by either downloading the zip file or cloning the repository.
git clone https://github.com/catsital/pycasso.git
cd
intopycasso
directory.- Run
python setup.py install
to install package.
- Run
python app/app.py
- Build from local using:
$ docker build -t "image-scramble" .
$ docker --name pycasso -p 5000:5000 -d image-scramble
- Get image from Docker Hub:
$ docker pull catsital/image-scramble
$ pycasso image_input.png image_output scramble
This will produce a scrambled image with seed based on your current system time. Hence, the output will be completely unpredictable and irreversible. Use the options -n
for slice_size
, -f
for format
, and -s
for seed
, like so:
$ pycasso image_input.png image_output scramble -n 50 50 -s seed -f jpeg
Initialize a Canvas
and use scramble on export
by:
from pycasso import Canvas
Canvas('image_input.png', (30, 30), 'seed').export('scramble', 'image_output', 'jpeg')