Skip to content

Chi-Firka/frame-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frame Splitter

A tool for converting animated PNG and GIF files into sprite atlases.

Русская версия

Description

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

Requirements

  • Python 3.x
  • Pillow 10.2.0

Installation

  1. Clone the repository:
git clone https://github.com/Chi-Firka/frame-splitter.git
cd frame-splitter
  1. Install the dependency using one of these methods:
pip install Pillow==10.2.0
# or
pip install -r requirements.txt

Usage

Processing a single file

python frame-splitter.py "path/to/file.png(.gif)"

Processing a directory

python frame-splitter.py "path/to/directory"

Results

  • 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

Features

  • 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

Example

py frame-splitter.py "E:\Desktop\sprite-splitter\av.gif"

From: av.gif (90x90)

av

To: av_atlas.png (720x90)

av_atlas

License

MIT License

Read LICENCE.md for more details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages