https://github.com/billy-enrizky/image_shuffle
A Python utility for shuffling and augmenting image data stored as .npy files. Designed to enhance machine learning datasets by generating randomized variations of image arrays through grid-based shuffling, split operations, and rotations.
https://github.com/billy-enrizky/image_shuffle
data-processing image-processing image-shuffler numpy shuffler
Last synced: 7 days ago
JSON representation
A Python utility for shuffling and augmenting image data stored as .npy files. Designed to enhance machine learning datasets by generating randomized variations of image arrays through grid-based shuffling, split operations, and rotations.
- Host: GitHub
- URL: https://github.com/billy-enrizky/image_shuffle
- Owner: billy-enrizky
- License: mit
- Created: 2024-11-07T06:11:45.000Z (11 months ago)
- Default Branch: new_branch
- Last Pushed: 2025-01-29T15:18:27.000Z (9 months ago)
- Last Synced: 2025-08-26T06:39:40.673Z (about 2 months ago)
- Topics: data-processing, image-processing, image-shuffler, numpy, shuffler
- Language: Jupyter Notebook
- Homepage: https://billy-enrizky.github.io/image_shuffle/
- Size: 1.69 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# image-shuffler
Split an image into n-pieces and shuffle them.

## Download
You can simply:
```sh
pip install image-shuffler
```Or you can also:
1. Clone the repository to your local machine.
2. Enter the directory.
3. Download necessary modules/libraries.```sh
git clone https://github.com/gabrielstork/image-shuffler.git
cd image-shuffler
pip install -r requirements.txt
```## How to use
First, you need to import the `Shuffler` class.
```python
from image_shuffler import Shuffler
```Then, instantiate it passing a valid path of an image as its argument.
```python
image = Shuffler('lenna.png')
```Now, to actually shuffle, you need to use the `shuffle()` method. The `matrix` parameter defines the number of pieces that will be in `x` and `y`, in this case, there will be a total of 16 pieces (you can see it in the image on the top of this file).
```python
image.shuffle(matrix=(4, 4))
```To take a look at the shuffled image, you can use the `show()` method (a new window will pop up).
```python
image.show()
```No arguments are needed to save the image. It will be saved in the same directory as the oringinal one and, in this case, with `shuffled_lena.png` as its name.
```python
image.save()
```[](https://github.com/gabrielstork)
[](https://github.com/gabrielstork)