Shuffle an image using Python
Split an image into n-pieces and shuffle it.
Installation
How to use
First we need to import the
Shuffler
class.
Then, instantiate it passing a valid path of an image as its argument.
Now to actually shuffle it, we need to use
shuffle()
method. The matrix defines the number of pieces that will be inx
andy
, in this case, there will be a total of 16 shuffled pieces. we can see it in the image on the top of this file.We can take a look at the image, using this method a new window will pop up.
It will be saved in the same place and, in this case, with
shuffled_marvin.jpg
as its name.
Resource of the week
SimpleCV
The Open Source Framework for Machine Vision.