A tool for converting animated PNG and GIF files into sprite atlases.
This script allows you to:
- Extract individual frames from animated PNG/GIF files
- Create horizontal sprite atlases from animation frames
- Process both single files and entire directories with PNG/GIF files
- Preserve the proportions and dimensions of source frames
- Python 3.x
- Pillow 10.2.0
- Clone the repository:
git clone https://github.com/Chi-Firka/frame-splitter.git
cd frame-splitter
- Install the dependency using one of these methods:
pip install Pillow==10.2.0
# or
pip install -r requirements.txt
python frame-splitter.py "path/to/file.png(.gif)"
python frame-splitter.py "path/to/directory"
- When processing a single file: creates a new file with the
_atlas.png
suffix in the same directory - When processing a directory: creates an
atlas_output
subdirectory, preserving the source directory structure
- Supports frames of any size
- Output atlas preserves the height of source frames
- Atlas width equals (number of frames × frame width)
- Supports transparency (RGBA format)
- Automatic creation of necessary directories for output files
py frame-splitter.py "E:\Desktop\sprite-splitter\av.gif"
From:
av.gif (90x90)
To:
av_atlas.png (720x90)
MIT License
Read LICENCE.md for more details