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

https://github.com/naporin0624/pixel-art-rust

A high-performance Rust implementation for creating stunning pixel art
https://github.com/naporin0624/pixel-art-rust

cli graphics image-processing pixel-art rust

Last synced: 9 months ago
JSON representation

A high-performance Rust implementation for creating stunning pixel art

Awesome Lists containing this project

README

          

# 🎨 Pixel Art Rust


Pixel Art Rust Banner



CI Status


Crates.io


Documentation

## Overview

Pixel Art Rust is a high-performance command-line tool that converts regular images into pixel art using advanced color quantization algorithms. Built with Rust for speed and reliability, it offers multiple algorithms and real-time progress visualization.

## ✨ Features

- 🚀 **Blazing Fast** - Parallel processing with Rayon
- 🎯 **Multiple Algorithms** - Average, Median Cut, K-Means, and Adaptive Quadtree
- 📊 **Real-time Progress** - Beautiful progress bars with indicatif
- 🔧 **Flexible** - Customizable grid sizes and color palettes
- 🎨 **High Quality** - Perceptually uniform LAB color space support
- 💾 **Memory Efficient** - Optimized for large images

## 🖼️ Demo


Original
Average
Median Cut
K-Means






### Processing Methods


Uniform Grid (32x32)
Adaptive Quadtree




## 📦 Installation

### Prerequisites
- Rust 1.70+ (for SIMD support)
- cargo

### From Source
```bash
git clone https://github.com/naporin0624/pixel-art-rust.git
cd pixel-art-rust
cargo build --release
```

### From Crates.io
```bash
cargo install pixel-art-rust
```

## 🚀 Usage

### Basic Usage
```bash
pixel-art-rust -w 32 -h 32 -i input.jpg -o output.png
```

### Advanced Options
```bash
# K-Means with 16 colors
pixel-art-rust -w 64 -h 64 -i photo.jpg -o pixel.png --algorithm kmeans --colors 16

# Adaptive quadtree mode
pixel-art-rust --adaptive -i photo.jpg -o adaptive.png --max-depth 8 --variance-threshold 30.0

# Median cut algorithm
pixel-art-rust -w 128 -h 96 -i landscape.png -o retro.png --algorithm median-cut
```

### All Options
```
-w, --width Number of horizontal divisions
-h, --height Number of vertical divisions
-i, --input Input image path
-o, --output Output image path
-a, --algorithm Color extraction algorithm [default: average]
[possible values: average, median-cut, kmeans]
-c, --colors Number of colors for quantization
--adaptive Use adaptive quadtree instead of uniform grid
--max-depth Max depth for quadtree [default: 10]
--variance-threshold Variance threshold for splitting [default: 50.0]
```

## 🧮 Algorithms

| Algorithm | Speed | Quality | Best For |
|-----------|-------|---------|----------|
| Average | ⚡⚡⚡ | ⭐⭐ | Quick previews |
| Median Cut | ⚡⚡ | ⭐⭐⭐ | Balanced results |
| K-Means | ⚡ | ⭐⭐⭐⭐ | High quality |
| Quadtree | ⚡⚡ | ⭐⭐⭐⭐ | Adaptive detail |

See the [documentation](https://naporin0624.github.io/pixel-art-rust) for detailed explanations.

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.