Home Community projects (finished & showcase) [BlushyFace.Util] Extract GIF files to spritesheets + GUI

[BlushyFace.Util] Extract GIF files to spritesheets + GUI

by BlushyFace

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

Note: This is a stripped down version of the BlushyFace.Util library that is used for my other projects (such as BlushyAvatars etc) written in C#. This version does not provide / generate a meta data file such as frame time and other info that might be useful to include when using the generated sprite sheet or other features such as adding padding, resizing etc.

Requirements
.NET framework 4.7x or higher + internet connection if you are converting files from the internet.

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 blushyface.com/b/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

 

Related Articles