Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Kasumi
Pages: [1]

General Discussion / Graphics Gale (?) GIF Frame Disposal Fixing
« on: June 18, 2016, 07:02:33 am »
Turn this:

Back into this:

(For Duelyst by Atnas)
You may have had that problem before.
The Problem
Graphics Gale gives its users power over choosing "frame disposal" per frame. If it's not set properly and saved this occasionally creates problems on reloading. (One or all frames are now combinations of themselves and the previous frame).
The Solution
Gifsicle lets you do all sorts of things with GIF files, but not everyone is great with command line apps. I made a simple Windows script file you can drag a broken gif to and it will tell gifsicle to create eight variations of the file with different disposal options.

Download the script from here.

To use:
1. Download a Windows build of Gifsicle from here: (Click Windows Ports.)
2. Extract it.
3. Copy "giffix.bat" to the same folder as "gifsicle.exe"
4. Drag your broken .gif file over "giffix.bat"

You'll get eight files ([originalfilename]_0.gif through [originalfilename]_7.gif) one of which may have the frames unmerged.

This .bat will overwrite [originalfilename]_0.gif through [originalfilename]_7.gif without asking. If you have files named like that you want to keep, move them before dragging [originalfilename] over the .bat. 

I am not responsible Gifsicle itself, nor the Windows ports. This script is provided as is with no warranty or guarantee of support.

This obviously can't fix everything. If you save your broken gif again, it's possible the broken frame can no longer be separated with frame disposal changes.
Like this one:

(Roll Caskett by Conzeit)

If your GIF actually did require different types of disposal in the same animation, this won't give you a single file you can continue from. It may still split the frames you're looking to split so you can copy them back to your original file.

This .bat doesn't offer you much if you're familiar with command line apps.
The Story
A user came on Slack with a broken GIF. I looked around and didn't find a program that could fix it. (Gifsicle could have, I even looked at Gifsicle, but I missed that it did this.) I quickly researched the GIF format and wrote a standalone program that fixed that GIF. Others have since asked me for the program, but the way it did things wasn't really very smart. Since I've now realized Gifsicle can do it, I may as well just release a script that makes Gifsicle as simple to use for the same purpose.

What is Frame Disposal?
"Frame Disposal" is a feature of the GIF file format. It tells the program displaying the gif what to do with the previous frame when the next one should be displayed. It can erase the previous frame (with a transparent color or the background color), or draw the next frame on top of the old frame.

A practical use of Frame Disposal is to save a bit on filesize (important when gif first appeared).

See this GIF of Shiki Ryougi from Melty Blood:

The bottom portion of the image never changes, so it could be stored only once in the first frame. The other six would just draw the new head on top of the old head.

Frame Disposal can also be used to do totally impractical things. A single GIF "frame" can only have 256 unique colors. This GIF:

(from wikipedia)
Takes advantage of not erasing the previous frame so that it can draw more than 256 colors. You can even have what appears to be a non animated gif contain way more than 256 colors (every frame has no delay, draws on top of the previous frame with a new group of colors each time, and doesn't loop).
Eddie Kohler for making Gifsicle which this requires.
Yaomon who originally showed there was a need for this.
Conzeit who went above and beyond with breaking files to test the original standalone.
Atnas who made me post this thread.

Yaomon AGAIN because he made me realize this gif which I'd had on my computer for like years:

had a disposal issue:

I always assumed it was supposed to be like that. And maybe it is, but it's cool to see it the other way regardless. I never would have written the standalone program, or even thought about it if not for Yaomon.

If anyone knows the source of that anime gif, please let me know!
Edit: Probable source:

Pages: [1]