21

As partly mentioned in this: Add delay to the final frame of a GIF? we can use "AnimationRepetitions" -> ∞ to loop a GIF indefinitely: Export["C:\\Users\\Ali Hashmi\\Desktop\\test.gif", gif, "AnimationRepetitions" -> ∞]


15

Add ImagePadding -> 0. g = Table[Graphics[{Thickness[0.01], Table[{Circle[{0 + x, 0}, r], Circle[{2 - x, 0}, r]}, {r, 0.001, 1.0, 0.05}]}, ImageSize -> {800, 400}, ImagePadding -> 0], {x, 0, 1, 0.02}]; SetDirectory@NotebookDirectory[] Export["moire_pattern.gif", g]


15

Note for Version 11.1: As commented by LCFactorization the option setting "TransitionEffect" -> Background is no longer working (error message + nothing exported). The solution is to use "TransitionEffect" -> "Background" instead, which doesn't produce the desired result in version 10.4 and earlier. By default the frames of a GIF are stacked on ...


10

I talked to the relevant developer and it turns out this is indeed a regression. It looks as if the default "DitheringMethod" changed from "FloydSteinberg" to None. Compare "DitheringMethod" pointing to None, Automatic, and "FloydSteinberg" in 10.4 and 11.1: Table[Labeled[ ImportString[ExportString[Graphics3D[Sphere[]], "GIF", "DitheringMethod" -> ...


10

You can simply increase the display duration for the last frame. Export["test.GIF", frames, "Interlaced" -> True, "DisplayDurations" -> ReplacePart[Table[0.1, Length[frames]], -1 -> 1.0], "AnimationRepetitions" -> ∞] Citing the GIF documentation: "DisplayDurations"->{d1, d2, ...} specifies the display durations for each frame in an ...


9

You should export just the List, not the object created by Animate. For this, Table is a good idea. Export["vectors.gif", Table[Graphics[{White, Arrow[{{0, 0}, {a, b}}]}, GridLines -> Automatic, Axes -> True, Background -> Black, PlotRange -> {{-5, 5}, {-5, 5}}], {a, -2, 2, 0.25}, {b, -2, 2, 0.25}]] On the other hand: You seem to have two ...


9

Using the two images {i1, i2} = {Import["https://i.stack.imgur.com/vmG0o.png"], Import["https://i.stack.imgur.com/bOkO8.png"]} create two polygons Textured with the two images: {g1, g2} = {Texture@#, Polygon[p = Table[#2 {Sin @ t, Cos @ t}, {t, 0, 2 Pi, Pi/32}], VertexTextureCoordinates -> Transpose[Rescale /@ Transpose@p]]}&@@@{{i1, 1}, {...


9

I know halirutan has already provided an answer, but here's a nice way to deal with GIF import in a frame-wise manner (or really in chunks of frames). Mathematica does a very dumb thing when it reads GIFs. It calls the function System`Convert`CommonGraphicsDump`IEImageRead which, if intelligent, would merely process the requested frames. Instead it always ...


7

The bad news is that your code spiked at about 60 GB RAM on my machine before the result is returned. The problem is clearly the Import routine. I would like to offer an alternative if you have more than 22 GB of RAM available. data = Import[file, {"GIF", "RawData"}]; This gives you the list of frames. Each frame is a matrix of color-indices. So to ...


7

As @mattiav27 already commented, I too suspected an optical illusion so I added two lines to the graphic as in g = Table[ Graphics[{Thickness[0.01], Table[{ Red, (*new*) Line[{{-1, 0.95}, {3, 0.95}}], (*new*) Line[{{-1, -0.95}, {3, - 0.95}}],(*new*) Black,(*new*) Circle[{0 + x, 0}, r], Circle[{2 - x, 0}, r]}, {r, 0.001, 1.0, 0.05}]}, ImageSize -> {600,...


7

I'd just make a set of frames and export those: frames = Table[ Show[ ParametricPlot[Evaluate[{x[t], y[t]} /. ss1], {t, tmax - 1, tmax}, PlotStyle -> {Thick, Green}, PlotRange -> 1.4, AspectRatio -> 1, PerformanceGoal -> "Quality"], Graphics[{PointSize[.03], Red, Point@{x[tmax], y[tmax]} /. ss1}, PlotRange -> 1....


7

This is indeed a bug in 11.3 and there is no way to export a gif that will only play once. That bug will be fixed in the next release. Here is a simple workaround you can use: ExportSingleAnimationGIF[fname_String, expr_, opts___] := With[{ bytes = StringToByteArray[ExportString[ expr, "GIF", opts, CharacterEncoding -> "ISO8859-1"], "ISO8859-1"], ...


6

I have investigated the problem and it seems that this is indeed a limitation of Export. We will add support for "TransitionEffect" option in Export in the next release of Mathematica. In the meantime, as a workaround, you can use a low-level function from GIFTools paclet GIFTools`Private`$WriteFrames. The function is not documented because it is not ...


6

There are several issues here. First, it is not clear for your 2D variables whether you want Table[{r, r}, {r, -1, 1, .5}] (* {{-1., -1.}, {-0.5, -0.5}, {0., 0.}, {0.5, 0.5}, {1., 1.}} *) or, you want something like Table[{rx, ry}, {rx, -1, 1, .5}, {ry, -1, 1, .5}] (* {{{-1., -1.}, {-1., -0.5}, {-1., 0.}, {-1., 0.5}, {-1., 1.}}, ... {{0.5, -1.}, {...


6

Here's a real quick example that does what you're looking for: Export["test.gif", ImageResize[#,100] & /@ Table[ImageTrim[Import["ExampleData/coneflower.jpg"], {{0,0},{m,m}}],{m,100,50,-5}] , "GIF"] Here we use ImageResize to set the final image size, and use ImageTrim to pick which section of the image you're zooming into. Exporting a ...


5

"DisplayDurations" works fine but there are limits to the values it accepts, and there are also limits on the performance of the software you use to open the file. IE I think the main problem is with the browser not allowing such frame rates . Reportedly IE allows only a Maximum Frame-rate ~16 fps. Microsoft claims it's because Legacy compatibility. But ...


5

You can change the specific functions and speed etc.of course, but how about something like this? im1 = ImageReflect[Import["1.jpg"]]; ima = Raster[ImageData[im1], {{-1.5023, -1}, {1.5023, 1}}]; gif = Table[ Graphics[Scale[Translate[ima, {Sin[a], Sin[Cos[a]]}], Cos[Sin[a]]], ImageSize -> Medium, PlotRange -> {{0, 1}, {0, 1}}], {a, 0, 2 Pi, ...


4

To export to an animated PNG with transparency you should convert Graphics to Image first: list = Table[Image[Show[TestCube[t], ViewPoint -> {1000, 1000, 1000}]], {t, 0, 360, 1}]; Then, you call Export: In[9]:= Export["CubesAnimation.png", list] Out[9]= "CubesAnimation.png" In[10]:= ImageMeasurements[Import["CubesAnimation.png", {"ImageList"...


3

That's because when exporting to a gif, it actually takes a list of images. So what you actually want is g1 = Table[ Plot[{Log[x], (x^(1 - a) - 1)/(1 - a)}, {x, 0, 5}, PlotLegends -> "Expressions"], {a, 0, 0.99, .99/100} ]


3

How do we correct this? How would I turn this into a gif? One question at a time please. For the first part, your code is not that easy to follow. Below I will only make it work, without rewriting completely (no time). First, you need to set the constant of integration correctly. Also fix Manipulate to make it work right. This below does that ClearAll[y, ...


3

I believe that you can achieve your desired result by generating by using iterators as in the following modification of your code: pgrid = Graphics[ Flatten[Table[Point[{i, j}], {i, -2, 2, 0.1}, {j, -2, 2, 0.1}]], Axes -> True, AxesOrigin -> {-2, -2}, PlotRange -> {{-2, 2}, {-2, 2}}]; dat1 = Flatten@ Table[Show[pgrid, Graphics[{...


2

It's actually quite an ugly code, but it should do the job: twogifs[X_, Y_] := ( a = Import[X]; b = Import[Y]; ai = ImageDimensions[a[[1]]]; b1 = ConstantArray[0, Length[b]]; For[i = 1, i < Length[b] + 1, i++, b1[[i]] = ImageResize[b[[i]], ai]]; If[Length@a < Length@b1, AppendTo[a, ConstantArray[a[[-1]], Length@b1 - Length@a]]; ...


2

Put all the images in a folder by themselves, then use the following code: imagePaths = FileNames["path/to/images/*.png"]; images = Import /@ imagePaths;


1

I suggest ClearAll[X, Cr, Eig2]; X[t_, p_] := Table[{Sin[t + (k Pi)/p]}, {k, 0, 8}]; Cr[t_, p_] := Cr[t, p] = NIntegrate[X[s, p].Transpose[X[s, p]], {s, 0, t}] // Quiet; Eig2[t_, p_] := Eigenvectors[Cr[t, p]][[1]]; Then try Animate[GraphicsGrid[{{MatrixPlot[Cr[2 Pi, u], ImageSize -> {350, 350}], Plot[X[t, u], {t, 0, 2 Pi}], ListPlot[Eig2[2 Pi, u]]...


1

If I understand the question correctly, the purpose is to be able to show animations during a presentation without having to wait for them to load or be generated. What I would do is to create a master notebook that produces the animations, and then a presentation notebook that only displays the animations. After running the producer notebook, click on ...


1

I get an animation in less than 3 seconds doing Import[path, "Animation"] plus 1 second or 2 for notebook formatting. Most of the operations give similar timings for a 1.1 MB "GIF" file. TableForm[ {#, First@AbsoluteTiming[Import[path, #]]} & /@ Import[path, "Elements"] ] After the comment by @b3m2a1 linking to this answer, it seems this ...


1

This appears to be a bug in Import that was fixed in Mathematica 11. To get the same output in Mathematica 10.4, we might use frames = Import["https://i.stack.imgur.com/wPp7l.gif"]; ListAnimate[frames]


1

Export the following to obtain the desired file Table[Graphics[{White, Arrow[{{0, 0}, 2 Sqrt[2] {Cos[c], Sin[c]}}]}, GridLines -> Automatic, Axes -> True, Background -> Black, PlotRange -> {{-5, 5}, {-5, 5}}], {c, -3 Pi/4, Pi/4, Pi/8}]


Only top voted, non community-wiki answers of a minimum length are eligible