img2gb - Converts Images to GameBoy Tileset and Tilemap
img2gb generates GameBoy Tilesets and Tilemaps from standard image (PNG, JPEG,…). It converts the images into the GameBoy image format and generates C code (.c and .h files) that can be used in GameBoy projects.
Documentation: https://flozz.github.io/img2gb/
Dependencies
Python >= 3.9
Pillow >= 5.0
Install
Usage
Hacking
Setup
To work on img2gb first create a virtualenv:
python3 -m venv __env__
and activate it:
source __env__/bin/activate
Then install the project with all dev dependencies:
pip install -e .[dev]
Commands
You can lint the code and check coding style with:
nox -s lint
You can fix coding style using Black with:
nox -s black_fix
You can run test on all supported Python versions or on a specific Python version with:
nox -s test # Run on all Python version nox -s test-3.9 # Run on Python 3.9 nox -s test-3.10 # Run on Python 3.10 nox -s test-3.11 # Run on Python 3.11 nox -s test-3.12 # Run on Python 3.12 nox -s test-3.12 # Run on Python 3.13
And you can build the documentation with (result in build/html/):
nox -s gendoc
Links
Examples of GameBoy programs that uses img2gb for graphics: * https://github.com/flozz/gameboy-examples/tree/master/05-graphics2 * https://github.com/flozz/gameboy-examples/tree/master/06-graphics3-background
Article about the tile encoding and img2gb: https://blog.flozz.fr/2018/11/19/developpement-gameboy-5-creer-des-tilesets/ (French)
Support this project
Want to support this project?
Changelog
[NEXT] (changes on master, but not released yet):
Nothing yet ;)
v1.3.0:
feat: Added binary export of tilesets and tilemaps (@duysqubix, #44)
misc: Added Python 3.13 support (@flozz)
misc!: Removed Python 3.8 support (@flozz)
v1.2.0:
fix: Fixed wrong version displayed (@flozz, #3)
chore: Added Python 3.11 and 3.12 support
chore!: Removed Python 2.7 and 3.7 support
v1.1.0:
Removes arbitrary size limit for tilmaps
Implements offset option (#2)
v1.0.0:
Refacto of the Python API, with new high-level fuction to be easier to use
Refacto of the CLI: now tileset and tilemap are generated separately, this allow more options for both and covers more usecases.
New option to handle alternative palette
New option to handle 8x16px sprites
Documentation
Unit test (everything is not coverd but it is better than nothing :))
v0.10.0: Adds non-RGB image support (indexed images,…)
v0.9.1: Fixes an issue with Python 3
v0.9.0: Initial release (generates tiles, tilesets and tilemaps)
Metadata
Release files for img2gb 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| img2gb-1.3.0.tar.gz | 15.6 kB | Without provenance | Details for img2gb-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| img2gb-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for img2gb-1.3.0-py3-none-any.whl |
Total release size: 30.5 kB
Release files / img2gb-1.3.0.tar.gz
| Download URL | img2gb-1.3.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a0395820d6f6d3dc3dd19477cd5e8cc3ab3936fa6674dc6fc46e18e719f3976
|
|
BLAKE2b-256 checksum How to use checksums |
120661333fd4594d2c5003820fae05ac648f4de0b65936af7d71e73385b2dd9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / img2gb-1.3.0-py3-none-any.whl
| Download URL | img2gb-1.3.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0662c719d211b380d5549a2af12da220e5cdf22fe9097c118282ba462602f43f
|
|
BLAKE2b-256 checksum How to use checksums |
d08976fa8015ffd78a194b4b9778890e8ab7496c99a232a7dac1a9e3c8197ee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for img2gb 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.