# 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
```sh
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
```sh
pip install python-chess pillow imageio cairosvg
```
Install `chessanimate`
```sh
git clone https://github.com/djstompzone/chessanimate ~/chessanimate
cd ~/chessanimate
pip install .
```
You'll also need to manually install system dependencies
```sh
# 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
```sh
python -m chessanimate game.pgn
```
The output will be saved as `chess_animation.gif`.
### Customization
To customize the frame duration
```sh
python -m chessanimate game.pgn -d 500
```
To specify the output filenane
```sh
python -m chessanimate game.pgn -o animation.gif
```
For a full list of arguments, you can view the help
```sh
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](https://github.com/djstompzone)
Repo: [GitHub - chessanimate](https://github.com/djstompzone/chessanimate)
Raw data
{
"_id": null,
"home_page": "https://github.com/djstompzone/chessanimate",
"name": "chessanimate",
"maintainer": "DJ Stomp",
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": "85457381+DJStompZone@users.noreply.github.com",
"keywords": null,
"author": "DJ Stomp",
"author_email": "85457381+DJStompZone@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/82/ea/548aea13f9e28fefe066c24dce1f3f62fe151dcb883b25ce61c0820b1948/chessanimate-1.0.0.tar.gz",
"platform": null,
"description": "# Chess Game Animation\n\nThis project generates an **animated GIF** of a chess game from a **PGN** file.\n\n## Features\n- Parses PGN files to extract moves\n- Generates board images for each move\n- Creates an animated GIF showing the game's progression\n\n## Installation\n\n### Conda (Recommended)\n\nInstall dependencies and activate the environment\n\n```sh\nconda create -n chess-animation -c conda-forge cairo pango gdk-pixbuf ffmpeg python-chess pillow imageio cairosvg\nconda activate chess-animation\n\nInstall chessanimate with Pip\n\n```sh\ngit clone https://github.com/djstompzone/chessanimate ~/chessanimate\ncd ~/chessanimate\npip install .\n```\n\n### Manual Installation with Pip\n\nInstall python dependencies\n\n```sh\npip install python-chess pillow imageio cairosvg\n```\n\nInstall `chessanimate`\n\n```sh\ngit clone https://github.com/djstompzone/chessanimate ~/chessanimate\ncd ~/chessanimate\npip install .\n```\n\nYou'll also need to manually install system dependencies\n\n```sh\n# Debian/Ubuntu\nsudo apt install libcairo2-dev libjpeg-dev libgif-dev\n\n# macOS\nbrew install cairo\n```\n\n## Usage\n\nRequires a **PGN** file (e.g., `game.pgn`)\n\n### Basic Usage\n\n```sh\npython -m chessanimate game.pgn\n```\n\nThe output will be saved as `chess_animation.gif`.\n\n### Customization\n\nTo customize the frame duration\n\n```sh\npython -m chessanimate game.pgn -d 500\n```\n\nTo specify the output filenane\n\n```sh\npython -m chessanimate game.pgn -o animation.gif\n```\n\nFor a full list of arguments, you can view the help\n\n```sh\npython -m chessanimate --help\n```\n\n## Dependencies\n- **python-chess** - Chess board rendering & PGN parsing\n- **Pillow** - Image processing\n- **imageio** - GIF creation\n- **cairosvg** - Converts SVG to PNG\n- **Cairo** - Required for SVG rendering\n\n## Output Example\n\n\n\n## License\n\nMIT License.\n\n## Credits\n\nAuthor: [DJ Stomp](https://github.com/djstompzone)\nRepo: [GitHub - chessanimate](https://github.com/djstompzone/chessanimate)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Creates GIF animations from .PGN chess games",
"version": "1.0.0",
"project_urls": {
"Discord": "https://discord.stomp.zone",
"Documentation": "https://github.com/DJStompZone/chessanimate/blob/main/README.md",
"Homepage": "https://github.com/djstompzone/chessanimate",
"Repository": "https://github.com/djstompzone/chessanimate"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5513711c3d1c521d21c3237ad17fe7f45b66b3140a4a282237e87f3c8d06f5f0",
"md5": "f457957b05e0b0234aae796f544d5981",
"sha256": "5ed20243e9f9965a4955c02fe9a24de6e3d2e579d3a99e3ea897e3de5ebe138c"
},
"downloads": -1,
"filename": "chessanimate-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f457957b05e0b0234aae796f544d5981",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 3169,
"upload_time": "2025-02-10T01:03:50",
"upload_time_iso_8601": "2025-02-10T01:03:50.350034Z",
"url": "https://files.pythonhosted.org/packages/55/13/711c3d1c521d21c3237ad17fe7f45b66b3140a4a282237e87f3c8d06f5f0/chessanimate-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82ea548aea13f9e28fefe066c24dce1f3f62fe151dcb883b25ce61c0820b1948",
"md5": "4bfa6555f37e6a13ae2759587114376a",
"sha256": "7bf6a3d166c5b1c4833d70584058910fa8c08507f9a290f1786056953169cb9f"
},
"downloads": -1,
"filename": "chessanimate-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "4bfa6555f37e6a13ae2759587114376a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 2362,
"upload_time": "2025-02-10T01:03:51",
"upload_time_iso_8601": "2025-02-10T01:03:51.293876Z",
"url": "https://files.pythonhosted.org/packages/82/ea/548aea13f9e28fefe066c24dce1f3f62fe151dcb883b25ce61c0820b1948/chessanimate-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-10 01:03:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "djstompzone",
"github_project": "chessanimate",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "chessanimate"
}