# Export infinite looping GIFs by default

frames=Table[Plot[Sin[x(1+a x)],{x,0,6}],{a,0,2,0.2}];
Export["test.gif",frames]


The above code runs in version 9.0 to get a infinite looping GIF animation, but in recent versions it only loops once.
I know I can specify the option "AnimationRepetitions" -> Infinity. Can this option be the default when exporting GIF? I have tried SetOptions[Export, "AnimationRepetitions" -> Infinity], it doesn't work.

• I'm unclear what you are looking for exactly. If I had a number of animations to export, I would write a simple myExport routine that would set the option for me. If you need it every session, you could put the definition in init.m. It doesn't seem much different to me that SetOptions (if that actually worked). – Michael E2 Jan 22 at 5:56
• I also struggle with this ever since they switched the default behavior. Is there a specific reason they changed this? In any case, I will definitely use your trick @MichaelE2 . Thanks! – Emy Jan 22 at 7:12

The final internal SystemConvertCommonGraphicsDumpexportImageListToGIF does not have Options and outer SystemConvertCommonGraphicsDumpexportImageListToRasterFormat has but handles other raster formats so it is not desirable to affect them.

What can be done is to re-register gif export. That needs to be done once per session, e.g. in init.m:

Begin["SystemConvertersDump"]

ImportExportRegisterExport[
"GIF",
SystemConvertCommonGraphicsDumpExportElementsToRasterFormat[
"GIF", ##, "AnimationRepetitions" -> Infinity (*here's the patch*)] &,
"Sources" -> {"ConvertCommonGraphics"},
"DefaultElement" -> Automatic,
"Options" ->
SortBy[{"AnimationDuration", "AnimationRepetitions", Background,

or you'd need to modify \$InstallationDirectory\SystemFiles\Formats\GIF\Export.m but modifying installation dir is not recommended.