Shuffle an image using Python
Split an image into n-pieces and shuffle it.
How to use
First we need to import the
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 in
y, 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.jpgas its name.
Resource of the week
The Open Source Framework for Machine Vision.
Thanks for reading Vigowebs’s Substack! Subscribe for free to receive new posts and support my work.