Share

Extract GIF files to spritesheet

Description
A way to extract GIF files into a sprite sheet.

Note: the library that is written is used for my other projects (such as BlushyAvatars etc) and this version does not provide / generate meta data file such as frame time and other info that might be useful to include when generating a sprite sheet or other features such as adding padding, resizing etc.

How to use
Look at the example code below how to use it.

The extracted files will be created in {basedir}\finished\ and the temp files (extracted frames) in {basedir}\temp\
To use it you need to add it to your project (example in VS -> references, add reference, find “BlushyFace.dll” and then click “OK”).

Basically there are 2 methods provided:

Utilities.DownloadFile(url of file, save location);
Utilities.ExtractGifToSpritesheet(output name, file location, save location, clean up temp files);

Example code

Example console output

Result (original)

result (output)

Download
The file can be downloaded in our discord server in the “home-of-blushies” look for “ConvertGifToSpriteSheet.rar” or blog.blushyface.com/download/gif-to-sprite-sheet-extractor/

Update
Made a GUI version for those that prefer that.

Update #1 added a checkbox to delete the extracted frames in \temp\

Update #2 added an “open directory” button to open output directory directly

Update #3 added “merge down” to merge extracted gifs / png’s as a single spritesheet