XaiJu
flinpaltwell
flinpaltwell

patreon


Blender/GIMP Tutorial: How to make a (seamless) GIF

Been a hot second since I did a tutorial, but I've been wanting to share this technique for a while now. It took time to work out all the steps, and now it's my standard workflow for all animations I export.

In this tutorial, I'll show you how to turn your Blender animation into a seamlessly looping GIF using GIMP.
Creating animations in Blender is beyond the scope of this tutorial. We'll mostly be focusing on GIMP, but I want to cover a few settings in Blender first.

---

As I write this, you can't render GIFs straight out of Blender. You can, however, render out a bunch of images, bring those into GIMP, and export a GIF that way.

Part 1: Making your animation seamless

First, you'll need an animation you've made in Blender. If you're looking to make an animation that seamlessly loops, there is one simple rule of thumb you must follow:

Your first frame and your last frame should be (almost) identical.

Here's what I mean:

Above is a dopesheet, with keyframes. The two sets of keyframes I've marked with red arrows are exactly the same.

As long as everything in your animation ends in the same way it starts, you'll have a seamless loop.
However, if you set your ending frame to be exactly the same as your start frame, then your looping animation ends up playing the same image twice in a row. That's why above, you can see that my last keyframe happens just after the animation is set to end (at frame 20). It's "building up" to it, and when it loops back to the start frame, it'll "reach" it.

Anyway, there are other factors that play into whether or not an animation looks seamless, but that's your basic rundown. Next, we need to render out our animation.

Part 2: Rendering out your Animation

Once you have an animation built, it's time to render it! Click on the output properties tab and set it to render everything as a JPEG. Also change the "Output" field to be wherever you want your rendered frames to wind up:

This is not the only way, but there are a few reasons why I use JPEG here.

First, you don't want your background to be transparent, and JPEGs don't have alpha channels. If your background is transparent, it'll cause problems for your GIF later.

Second, PNGs are much larger, which will not only make your GIF way bigger, but can also lead to it loading slower.

Third, both of the above reasons also apply to making animations in Ren'Py, so it just makes sense for me to do it this way.

With your output destination and format set, just go to Render > Render Animation and watch your frames collect in a folder somewhere.

Part 3: Making a GIF out of your rendered frames

Once you're done, find the first rendered frame of your animation and open it up in GIMP. (Ignore the numbering of my frames; "0050" happens to be my first frame)

Next, select every remaining frame EXCEPT for your first frame, and drag-drop onto the empty grey layer area shown:

Tip: When you go to drag/drop, make sure you start your drag by clicking on the first image in your selection (in my case, it's "0051"). If you click and drag from some random image in the selection, I think that will show up first in the layer stack, which you don't want. You want these to all be in order.

Assuming everything went according to plan, you should now have all your frames layered in order, with the first frame at the top and the last frame at the bottom. Double check this. IT'S FUCKING IMPORTANT. If shit's out of order, it'll FUCK YOUR GIF UP, DO YOU GET IT??? You can drag layers around to reorder them.

Now that you're totally positive that your starting frame is the topmost layer and your ending frame is the bottommost layer, it's time to reverse them!

That's right, we need the bottom layer on top and the top layer on bottom. Otherwise, your gif will play in reverse when you go to export it.

So go to Layer > Stack > Reverse Layer Order.

Now your first frame should be on the BOTTOM, with each frame ascending in order to the top.

We could technically export out our GIF at this point, but there's one final problem you'll run into if you do.

Your GIF's quality will (probably) suck. Maybe not, but even if you skip this step, GIMP's just gonna do it anyway, except on its own terms. Fuck that.

So go to Image > Mode > Indexed. You'll see this window pop up:

Set it to 255 and hit "Convert." This can take a long time, so I'll explain what the fuck while we wait.

"Indexed" mode is saying, "across all these layers, let's make sure that ALL of them combined are using no more than 255 colors total. If there's more than that, we'll change the outliers that are less common to be the same as the next-most similar color."

255 is the max, and should basically have little impact on your imagery. If you wish to lower this value, it can lead to some cool effects, but in many cases it'll just look pretty bad.

GIMP can't export a GIF without the images being indexed, so even if you skip this step, you'll still have to sit here, waiting forever. However, in my experience, GIMP doesn't necessarily auto-calculate it properly on its own, so I manually have to do this step every time to ensure good quality.

Anyway, the indexing step can take a good 5-8 minutes even with cartoony stuff like I make, so if your imagery is very detailed, be prepared to wait a while.

Once it's done, we're ready to export! Go to File > Export As... and decide where you wanna save it. The only important thing you need to do here is change your file's name to end with ".gif" instead of ".png" or ".jpg." GIMP will be able to tell what you're trying to do.

Hit "Export," and you'll get one final screen:

Check on "As animation" and "Loop Forever." You don't need a GIF comment, so I check that off, but whatever.

The "Delay between frames where specified" is very important. This determines the playback rate of your GIF, and it can only be set in multiples of 10. Typing in "35" just rounds it up to 40. In any case, you can experiment with this, but if you're looking for a good "default" value, go with 40. 40 milliseconds between frames is 25 frames/second, which is pretty close to standard.

Then hit "Export."
You are done.

Blender/GIMP Tutorial: How to make a (seamless) GIF

Comments

Yes, Amy's example GIF here does indeed have hair physics automatically applying to her twintails as she tilts her head. Yes, it's cool as shit. No, I have not used this at all in LLRR. Yes, I have been able to do this the entire time. Yes, I will try to use this in Amy's next animation to make it up to you.

Flin Paltwell


More Creators