https://github.com/senselogic/pix
Sprite converter.
https://github.com/senselogic/pix
Last synced: 4 months ago
JSON representation
Sprite converter.
- Host: GitHub
- URL: https://github.com/senselogic/pix
- Owner: SenseLogic
- License: gpl-3.0
- Created: 2024-06-10T21:47:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-30T08:40:37.000Z (12 months ago)
- Last Synced: 2025-01-17T09:22:11.546Z (5 months ago)
- Language: D
- Size: 263 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Pix
Sprite converter.
## Installation
Install the [DMD 2 compiler](https://dlang.org/download.html) (using the MinGW setup option on Windows).
Build the executable with the following command line :
```bash
dmd -m64 pix.d color.d png.d
```## Command line
```bash
pix [options]
```### Options
```bash
--read-palette-png palette.png
--read-png sprite.png column_step row_step
--binarize threshold
--invert
--tile tile_column_count tile_row_count
--flatten column_count
--trim
--write-c sprite.c sprite_column_count sprite_row_count
```### Examples
```bash
pix --read-png sprite.png 1 1 --binarize 128 --write-c sprite.c 24 21
``````bash
pix --read-png sprite.png 1 1 --binarize 128 --invert --write-c inverted_sprite.c 24 21
``````bash
pix --read-png sprite.png 1 1 --binarize 128 --trim --write-c trimmed_sprite.c 24 21
``````bash
pix --read-png four_color_sprite.png 2 1 --read-palette-png four_color_palette.png --write-c four_color_sprite.c 24 21
``````bash
pix --read-png font.png 1 1 --binarize 128 --tile 4 8 --write-png tiled_font_1.png --tile -2 -4 --write-png tiled_font_2.png --flatten 32 --write-png flat_font.png --write-c font.c 0 0
```## Dependencies
* [ARSD PNG library](https://github.com/adamdruppe/arsd)
## Limitations
Only supports PNG files.
## Version
1.0
## Author
Eric Pelzer ([email protected]).
## License
This project is licensed under the GNU General Public License version 3.
See the [LICENSE.md](LICENSE.md) file for details.