Skip to main content

Split image into tiles and scramble/unscramble them with seed.

Project description

Pycasso

Downloads Latest PyPI release Latest Github release License Build Deploy

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:

example_scramble

Unscramble

To revert the image to its original state, use the same seed and slice_size on unscramble mode.

example_unscramble

Credits

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 into pycasso 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
$ docker pull catsital/image-scramble

Command-line utility

$ 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

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

image-scramble-2.1.2.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

image_scramble-2.1.2-py2.py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page