8
$\begingroup$

I was trying to create an animated .gif with Mathematica. I knew that the function to use was

Export["animation.gif",tableplot]

where tableplot contains the table of my plots. However, I also know that when creating a .gif, you can tune the duration of each frame. Looking at Wolfram Documentation Center for Export, I have not been able to identify how this duration could be selected.

Fortunately, looking at this answer, I found that the correct argument was

Export["animation.gif",tableplot,"DisplayDurations" -> 0.5]

It appears that the description of the available options could be found in the documentation under the ones associated with GIF.

However, how could one find the name of the option "DisplayDurations", if one does not have access neither to this thread neither to the Documentation ? Is there a way to find programmaticaly all the possible options associated to the Export as a .gif ? More generally, if I have a function f, is there a way to know all the possible options f can receive ?

$\endgroup$
7
  • 1
    $\begingroup$ "DisplayDurations" is an option for the GIF format not for the Export function. Follow the link provided by Öskå. You may want to read this answer. $\endgroup$
    – rhermans
    Nov 5, 2014 at 10:10
  • $\begingroup$ @Öskå @rhermans Thank you a lot : now I feel stupid for my question... ^^ More generally, if I give you a function f, is there a way to know all the possible options f can receive ? $\endgroup$
    – jibe
    Nov 5, 2014 at 10:13
  • $\begingroup$ Always read the Details section of the documentation. Loot at Options and its friends, AbsoluteOptions. I hope you don't mind, but this questions will be put on-hold. $\endgroup$
    – rhermans
    Nov 5, 2014 at 10:15
  • $\begingroup$ @rhermans If needed, this question can also of course be deleted, to keep the site clean. $\endgroup$
    – jibe
    Nov 5, 2014 at 10:19
  • 1
    $\begingroup$ You can find manual pages on the individual formats in the doc. ctr. The pages for Import and Export have a link near the top "Listing of Formats." Entering "GIF" in the search field yields the GIF page, which is quite extensive and explains several things about "DisplayDurations". The documentation of some formats seems less extensive or there is less to explain. $\endgroup$
    – Michael E2
    Nov 5, 2014 at 12:52

1 Answer 1

6
$\begingroup$

Part of export to gif options are here.

Options[System`ConvertersDump`exportDataToGIFConverter]

Obviously not all. As far as I can see in principle all Export[] and Import[] options are here

(Save["stdout", #] & /@ Names["System`ConvertersDump`*"])

As you can see they are hardcoded in a number of different functions. If you look only for export to GIF options, then I would restrict searching tosomehow smaller set of definitions, i.e. Names["SystemConvertersDumpGIF"].

You can extract all options using string manipulations like this:

nb = CreateTemporary[];
(Save[nb, #] & /@ Names["System`ConvertersDump`*GIF*"]);
str = Import[nb, "Text"];

Union[StringCases[str, "\"" ~~ LetterCharacter .. ~~ "\"" ~~ " -> " ]]

{"\"AnimationDisplayTime\" -> ", "\"AnimationRepetitions\" -> ", \ "\"Background\" -> ", "\"BitDepth\" -> ", "\"ColorMap\" -> ", \ "\"ColorReductionDither\" -> ", "\"ColorReductionPalette\" -> ", \ "\"ColorSpace\" -> ", "\"Comments\" -> ", "\"Data\" -> ", "\"DataType\ \" -> ", "\"DisplayDurations\" -> ", "\"DitheringMethod\" -> ", \ "\"Format\" -> ", "\"FrameCount\" -> ", "\"Frames\" -> ", \ "\"GlobalColorMap\" -> ", "\"Graphics\" -> ", "\"ImageCount\" -> ", "\ \"ImageOffset\" -> ", "\"ImageSize\" -> ", "\"ImageTopOrientation\" -> \ ", "\"Interlaced\" -> ", "\"RawData\" -> ", "\"ReadGIFData\" -> ", \ "\"RepeatAnimation\" -> ", "\"TransitionEffect\" -> ", \ "\"TransparentColor\" -> ", "\"UserInputFlag\" -> "}

Sure, not the best way, but at least partly works.

$\endgroup$
1
  • 2
    $\begingroup$ Well, that's already here :) $\endgroup$
    – Öskå
    Nov 5, 2014 at 10:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.