#
[](https://pypi.org/project/pyxel/)
[](https://github.com/kitao/pyxel)
[](https://github.com/kitao/pyxel)
[](https://github.com/sponsors/kitao)
[](https://ko-fi.com/H2H27VDKD)
[ [English](README.md) | [中文](docs/README.cn.md) | [Deutsch](docs/README.de.md) | [Español](docs/README.es.md) | [Français](docs/README.fr.md) | [Italiano](docs/README.it.md) | [日本語](docs/README.ja.md) | [한국어](docs/README.ko.md) | [Português](docs/README.pt.md) | [Русский](docs/README.ru.md) | [Türkçe](docs/README.tr.md) | [Українська](docs/README.uk.md) ]
**Pyxel** (/ˈpɪksəl/) is a retro game engine for Python.
With simple specifications inspired by retro gaming consoles, such as displaying only 16 colors and supporting 4 sound channels, you can easily enjoy making pixel-art-style games.
[
](https://github.com/kitao/pyxel/wiki/Pyxel-User-Examples) [
](https://gihyo.jp/book/2025/978-4-297-14657-3)
The development of Pyxel is driven by user feedback. Please give Pyxel a star on GitHub!
## How to Install
### Windows
After installing [Python3](https://www.python.org/) (version 3.8 or higher), run the following command:
```sh
pip install -U pyxel
```
When installing Python using the official installer, make sure to check the `Add Python 3.x to PATH` option to enable the `pyxel` command.
### Mac
After installing [Homebrew](https://brew.sh/), run the following commands:
```sh
brew install pipx
pipx ensurepath
pipx install pyxel
```
To upgrade Pyxel after installation, run `pipx upgrade pyxel`.
### Linux
After installing the SDL2 package (`libsdl2-dev` for Ubuntu), [Python3](https://www.python.org/) (version 3.8 or higher), and `python3-pip`, run the following command:
```sh
sudo pip3 install -U pyxel
```
If the previous command fails, consider building Pyxel from source by following the instructions in the [Makefile](Makefile).
### Web
The web version of Pyxel works on PCs, smartphones, and tablets with a compatible browser, without installing Python or Pyxel.
The easiest way to use it is through the online IDE [Pyxel Code Maker](https://kitao.github.io/pyxel/wasm/code-maker/).
For other usage patterns, such as embedding Pyxel apps on your own site, please refer to [this page](docs/pyxel-web-en.md).
### Try Examples
After installing Pyxel, you can copy the examples to the current directory with the following command:
```sh
pyxel copy_examples
```
The following examples will be copied to the current directory:
| 01_hello_pyxel.py | Simplest application | Demo | Code |
| 02_jump_game.py | Jump game with Pyxel resource file | Demo | Code |
| 03_draw_api.py | Demonstration of drawing APIs | Demo | Code |
| 04_sound_api.py | Demonstration of sound APIs | Demo | Code |
| 05_color_palette.py | Color palette list | Demo | Code |
| 06_click_game.py | Mouse click game | Demo | Code |
| 07_snake.py | Snake game with BGM | Demo | Code |
| 08_triangle_api.py | Demonstration of triangle drawing APIs | Demo | Code |
| 09_shooter.py | Shoot'em up game with screen transitions and MML | Demo | Code |
| 10_platformer.py | Side-scrolling platform game with map | Demo | Code |
| 11_offscreen.py | Offscreen rendering with Image class | Demo | Code |
| 12_perlin_noise.py | Perlin noise animation | Demo | Code |
| 13_custom_font.py | Drawing a custom font | Demo | Code |
| 14_synthesizer.py | Synthesizer using audio expansion features | Demo | Code |
| 15_tiled_map_file.py | Loading and drawing a Tile Map File (.tmx) | Demo | Code |
| 16_transform.py | Image rotation and scaling | Demo | Code |
| 17_app_launcher.py | Pyxel app launcher (you can play various games!) | Demo | Code |
| 99_flip_animation.py | Animation with flip function (non-web platforms only) | Demo | Code |
You can drag and drop an image file (PNG/GIF/JPEG) into the image editor to load the image into the currently selected image bank.
**Tilemap Editor**
The mode for editing **tilemaps** that arrange images from the image banks in a tile pattern.
Drag and drop a TMX file (Tiled Map File) onto the tilemap editor to load its layer 0 into the currently selected tilemap.
**Sound Editor**
The mode for editing **sounds** used for melodies and sound effects.
**Music Editor**
The mode for editing **music tracks** in which the sounds are arranged in order of playback.
### Other Resource Creation Methods
Pyxel images and tilemaps can also be created using the following methods:
- Create images or tilemaps from lists of strings with the `Image.set` or `Tilemap.set` functions
- Load palette-ready image files (PNG/GIF/JPEG) with the `Image.load` function
Pyxel sounds and music can also be created using the following method:
- Create them from strings with the `Sound.set` or `Music.set` functions
Refer to the API reference for the usage of these functions.
### How to Distribute Applications
Pyxel supports a cross-platform distribution format called a Pyxel application file.
Create a Pyxel application file (.pyxapp) with the `pyxel package` command:
```sh
pyxel package APP_DIR STARTUP_SCRIPT_FILE
```
If you need to include resources or additional modules, place them in the application directory.
Metadata can be displayed at runtime by specifying it in the following format within the startup script. Fields other than `title` and `author` are optional.
```python
# title: Pyxel Platformer
# author: Takashi Kitao
# desc: A Pyxel platformer example
# site: https://github.com/kitao/pyxel
# license: MIT
# version: 1.0
```
The created application file can be run using the `pyxel play` command:
```sh
pyxel play PYXEL_APP_FILE
```
A Pyxel application file can also be converted to an executable or an HTML file using the `pyxel app2exe` or `pyxel app2html` commands.
## API Reference
### System
- `width`, `height`
- `bltm(x, y, tm, u, v, w, h, [colkey], [rotate], [scale])`
- `text(x, y, s, col)`