https://github.com/maclovin/simple-pixel-sprite-generator
Medium and High resolution textures into retro-like textures and sprites.
https://github.com/maclovin/simple-pixel-sprite-generator
Last synced: 9 months ago
JSON representation
Medium and High resolution textures into retro-like textures and sprites.
- Host: GitHub
- URL: https://github.com/maclovin/simple-pixel-sprite-generator
- Owner: maclovin
- License: bsd-2-clause
- Created: 2025-03-09T17:44:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-09T22:27:37.000Z (over 1 year ago)
- Last Synced: 2025-03-09T23:23:44.977Z (over 1 year ago)
- Language: Python
- Size: 1.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Pixel Sprite Generator
Simple Pixel Sprite Generator is a lightweight Python tool that converts images into pixel art textures and spritemap by applying a pixelation effect. It can process a single image or a directory of images (supporting PNG and TGA formats), and can optionally generate a spritemap that arranges all processed images in a grid. The tool also provides an optional auto-contrast adjustment to enhance the clarity of the pixelated images.
## Features
- **Input Flexibility:** Process a single image or multiple images from a directory.
- **Supported Formats:** Works with PNG and TGA image formats.
- **Adjustable Pixelation:** Set the pixelation level with customizable values (suggested: 4, 8, 16, 32; default: 16).
- **Auto-Contrast Option:** Optionally apply auto-contrast adjustment to make images clearer.
- **Spritemap Generation:** Option to combine all processed images into one large PNG spritemap.
## Requirements
- **Python 3.x**
- **Pillow Library**
## Installation
1 - Clone or download the repository.
2 - Install the required dependency:
```
python3 -m pip install -r requirements.txt
```
## Usage
Run the script using Python from the command line. Below are some usage examples:
### Example 1: Process a Single Image
Process a single image with a pixel size of 4 and apply auto-contrast:
```
python3 simple-pixel-sprite-generator.py --input path/to/image.png --pixel-size 4 --auto-adjust
```
### Example 2: Process a Directory and Generate a Spritemap
Process all images in a directory, specify an output folder, and generate a spritemap:
```
python3 simple-pixel-sprite-generator.py --input path/to/images/ --output path/to/output/ --spritemap
```
## Samples



## Acknowledgements
- This tool leverages the Pillow library for image processing.
- Part of the "color auto-adjustment" code and the documentation of the methods was generated using ChatGPT o3-mini-high model.
- Feel free to adjust or expand upon this documentation as needed for your project.