Chess Game Animation
This project generates an animated GIF of a chess game from a PGN file.
Features
- Parses PGN files to extract moves
- Generates board images for each move
- Creates an animated GIF showing the game's progression
Installation
Conda (Recommended)
Install dependencies and activate the environment
conda create -n chess-animation -c conda-forge cairo pango gdk-pixbuf ffmpeg python-chess pillow imageio cairosvg
conda activate chess-animation
Install chessanimate with Pip
```sh
git clone https://github.com/djstompzone/chessanimate ~/chessanimate
cd ~/chessanimate
pip install .
Manual Installation with Pip
Install python dependencies
pip install python-chess pillow imageio cairosvg
Install chessanimate
git clone https://github.com/djstompzone/chessanimate ~/chessanimate
cd ~/chessanimate
pip install .
You'll also need to manually install system dependencies
# Debian/Ubuntu
sudo apt install libcairo2-dev libjpeg-dev libgif-dev
# macOS
brew install cairo
Usage
Requires a PGN file (e.g., game.pgn)
Basic Usage
python -m chessanimate game.pgn
The output will be saved as chess_animation.gif.
Customization
To customize the frame duration
python -m chessanimate game.pgn -d 500
To specify the output filenane
python -m chessanimate game.pgn -o animation.gif
For a full list of arguments, you can view the help
python -m chessanimate --help
Dependencies
- python-chess - Chess board rendering & PGN parsing
- Pillow - Image processing
- imageio - GIF creation
- cairosvg - Converts SVG to PNG
- Cairo - Required for SVG rendering
Output Example
License
MIT License.
Credits
Author: DJ Stomp Repo: GitHub - chessanimate
Metadata
Release files for chessanimate 1.0.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 | |
|---|---|---|---|
| chessanimate-1.0.0.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chessanimate-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / chessanimate-1.0.0.tar.gz
| Download URL | chessanimate-1.0.0.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bf6a3d166c5b1c4833d70584058910fa8c08507f9a290f1786056953169cb9f
|
|
BLAKE2b-256 checksum How to use checksums |
82ea548aea13f9e28fefe066c24dce1f3f62fe151dcb883b25ce61c0820b1948
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.12.2 Linux/6.2.1-PRoot-Distro
|
Release files / chessanimate-1.0.0-py3-none-any.whl
| Download URL | chessanimate-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ed20243e9f9965a4955c02fe9a24de6e3d2e579d3a99e3ea897e3de5ebe138c
|
|
BLAKE2b-256 checksum How to use checksums |
5513711c3d1c521d21c3237ad17fe7f45b66b3140a4a282237e87f3c8d06f5f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.12.2 Linux/6.2.1-PRoot-Distro
|