Rendering to Gif format

I don’t know how many other people are bothered by this, but it is something that I would really use and appreciate- the option to render to GIF. This option could save people a lot of time creating gif animations. I don’t know how easy it would be to integrate this option into blender, but I think it would be really cool if it was there.

Just wondered how many other people wanted this also.

You could write a tiny Python script to do the converting for you. You could use ImageMagick (http://www.imagemagick.com/) or PIL (http://www.pythonware.com/products/pil/).

Or if you feel like it you could hack it to the source itself.

VirtualDub(the experimental version) can convert into optimized animated GIFs. I usually just render out as PNG and then load up the image sequence in VirtualDub and Export as GIF. Nice and easy. But I do agree that it would be easier to just render it out as optimized GIF.

http://www.virtualdub.org/

The problem is that to do it right - I think you’d have to change the way the renderer works. For best results staying completely within the renderer, you’d have to render everything twice - once for a color analysis pass, once for actually creating the frames.

Since GIF uses an 8-bit indexed color palette, to really do it correctly you need to know the color range for ALL the frames so that you can create your palette before even making your first one. Since Blender is rendering a frame at a time, the best it could do would be to pick some non-optimized palette and use that for everything (unless it did some sort of ‘double render’ as mentioned before).

The best way is really to render to an image sequence or movie and use another tool (that now has the luxury of having all frames rendered) so that it can analyze the entire sequence and choose the best palette to apply to all frames.

GIF is a proprietary format, and due to one licensing issue or another, you will probably never see it in Blender. A separate python script would work though; has someone else done it already?

  1. Aren’t the patent issues about the GIF format obsolete?

  2. I don’t know what’s going on inside Blender but, clearly, it is not rendering directly to the chosen format but to an intermediary format from which it converts to any chosen format. Do this experiment: render something, chose JPEG, save the image (F3) and you get a JPEG image. Then, without rendering again, choses the PNG format and save again the image: you get a PNG image. And so on.
    So, if only I am right, Blender wouldn’t have to know anything prior to rendering and the colormap could be built after the rendering job is finished but before the conversion takes place.

J.

That’s not exactly what I meant. I probably wasn’t clear enough.

When you render a still image, it renders to a full color no-compression version so you can save it out into various formats - it just converts from the “full” version in memory to the format you want to save (no re-rendering required).

For a still image GIF this wouldn’t be a problem. For animated GIFs - the 256 color (indexed color) palette is shared across all frames so until you know all the frames, you can’t know what colors you’ll need in the palette.

As opposed to a still image where you can choose your format after rendering, when you render an animation, you DO choose your output format ahead of time as keeping a full uncompressed version of the animation in memory isn’t feasible.

The closest you could do would be to have the animated GIF format be understood in Blender - render to an animation format, and then convert the full animation using the sequence editor when it was done. (At this point, there is no difference in just rendering to uncompressed (or image sequence) and then letting another application do the conversion to GIF.)

Though, honestly, the GIF89A format is used less and less for anything anymore, so I doubt this is something that will really get a lot of attention.

You are right, I missed a point that an animation, even as a collection of stills, in converted frame by frame right after each is rendered.

Jean