An open API service indexing awesome lists of open source software.

https://github.com/zokis/img_to_pixel_art

Script that transforms any image into pixel art
https://github.com/zokis/img_to_pixel_art

Last synced: 12 months ago
JSON representation

Script that transforms any image into pixel art

Awesome Lists containing this project

README

          

# img_to_pixel_art

## Introduction
This project contains a Python script that transforms any image into pixel art. The script analyzes the image and determines the best block size for the pixel art based on color homogeneity. It also allows specifying a block size manually. The resulting pixel art image maintains the essential features and colors of the original image, but with a unique pixelated aesthetic.

## Installation
To run this script, you need Python installed on your machine. Clone this repository and navigate into the project directory. Then, install the required dependencies:

```bash
pip install -r requirements.txt
```

## Usage
Run the script with the following command:

```bash
python img_to_pixel_art.py
```

To specify a block size and the number of colors, use:

```bash
python img_to_pixel_art.py --n_colors

```

Replace with the path to your image file and with the desired size of each pixel block (optional).

## Learning Purpose

This project is intended for educational purposes. It provides a practical example of image processing using Python, demonstrating techniques such as color analysis, multiprocessing, and image manipulation with libraries like NumPy and PIL.

## Comparing Results
To see the difference between pixel art transformation and conventional resizing methods, compare the three images. The pixel art image will have a distinct, stylized appearance that differs significantly from the smoothly resized image.

### Original
![Original](vulcao.png "Original")

### Pixeled
![Pixeled](vulcao_6_pixeled.png "Pixeled")

### Resized
![Resized](vulcao_6_resized.png "Resized")

### Diff
![Diff](diff.png "Diff")