Split image into tiles and scramble/unscramble them with seed.
Project description
Pycasso
Split image into tiles and scramble/unscramble them based on a seed. The demo application can be found at https://image-scramble.herokuapp.com.
Scramble
Using scramble mode on this sample image will produce the following output:
Unscramble
To revert the image to its original state, use the same seed
and slice_size
on unscramble mode.
Credits
-
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.
Setup
Install from PyPI
$ pip install image-scramble
Install from source
- 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.
Usage
Web application
- Run
python app/app.py
Docker
- Build from local using:
docker build -t "image-scramble" .
docker --name pycasso -p 5000:5000 -d image-scramble
- Get image from hub:
docker pull image-scramble
Command-line utility
You can get started by using the command-line utility to scramble or unscramble an image by:
$ pycasso image_input.png image_output scramble
Use --help
for more options.
Script
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')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for image_scramble-2.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd7ae0780f584b216879b026c3328b225a2c27f96ad5924fbca23e7f3646375b |
|
MD5 | 337e328c7cc321931dce1b6c9b3729e9 |
|
BLAKE2b-256 | c8095eef919f1a940a6793fa690fbcb79621233cbd5e6d93621fe71722032b34 |