Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lchsk/simplepacker
Command-line tool that can create sprite sheets/sprite atlases
https://github.com/lchsk/simplepacker
game-development gamedev packer python spritesheet spritesheet-packer texturepacker
Last synced: 3 months ago
JSON representation
Command-line tool that can create sprite sheets/sprite atlases
- Host: GitHub
- URL: https://github.com/lchsk/simplepacker
- Owner: lchsk
- License: gpl-3.0
- Created: 2015-03-04T18:22:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:58:39.000Z (about 2 years ago)
- Last Synced: 2024-09-16T09:48:15.230Z (5 months ago)
- Topics: game-development, gamedev, packer, python, spritesheet, spritesheet-packer, texturepacker
- Language: Python
- Homepage:
- Size: 249 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simplepacker
Simplepacker is a command-line tool that can create sprite sheets/sprite atlases.
[![codecov](https://codecov.io/gh/lchsk/simplepacker/branch/master/graph/badge.svg)](https://codecov.io/gh/lchsk/simplepacker)
[![Build Status](https://travis-ci.org/lchsk/simplepacker.svg?branch=master)](https://travis-ci.org/lchsk/simplepacker)# Installation
```
$ pip install simplepacker
```# Basic use
Pack images from `./examples` directory.
```
$ simplepacker -i ./examples -o output1.jpg
```[![simplepacker output1](./examples/output/output1.1.jpg)]
Set maximum height, padding and generate a json file with metadata.
```
$ simplepacker -i ./examples -o output2.jpg --height 200 --padding 5 --json
```[![simplepacker output1](./examples/output/output2.1.jpg)]
Resulting json file:
```
{"feynman": {"x": 0, "y": 0, "w": 100, "h": 141, "name": "feynman", "ext": ".jpg", "image": "output2.1.jpg"}, "curie_sklodowska": {"x": 105, "y": 0, "w": 100, "h": 132, "name": "curie_sklodowska", "ext": ".jpg", "image": "output2.1.jpg"}, "einstein": {"x": 210, "y": 0, "w": 100, "h": 131, "name": "einstein", "ext": ".jpg", "image": "output2.1.jpg"}}
```With `--css` argument it can also generate CSS output.
# Arguments
|Argument|Description|
|---|---|
|`-h, --help`|See help screen|
|`-i, --input`|Input directory|
|`--width`|Maximum output width|
|`--height`|Maximum output height|
|`-p, --padding`|Padding|
|`-m, --margin`|Margin|
|`--css`|Generate CSS output|
|`--json`|Generate JSON output|
|`--use-params`|Use `.params` JSON files to add metadata to output JSONs|
|`--create-params-files`|Create an empty `.params` file for each input image|
|`--dont-resize-output`|Output images will always be equal to parameters set by `--width` and `--height`|
|`--sort-alphabetically`|Sort input images by name|