1
$\begingroup$

I cannot export a list of images (or a single image) to GIF format. I use Win10 with Mathematica 9.0. It previously worked on an other device with Win7. I can also export an image to other formats, like PNG or JPG.

Export["file.gif",image] produces an output which cannot be opened with anything (Windows Images, Paint, or any browser, ...). Export["file.png",image] works well.

Sorry if it's a common problem, but I haven't found an answer here.

An example code:

image = Plot[x, {x, 0, 1}]; SetDirectory[NotebookDirectory[]]; Export["file1.gif", image] Export["file2.jpg", image] 
$\endgroup$
9
  • $\begingroup$ I export to gif all the time, on windows 10. But I use V 12.1. No problems (other than it can slow). Can you post complete MWE where it fails? are you exporting frames of images or single image? $\endgroup$ Commented May 26, 2020 at 11:28
  • $\begingroup$ @Nasser I posted an expamle. It is only a single image, but I still cannot open the gif file, while I can the jpg. Is it possible that the problem isn't on Mathetmatica's side? $\endgroup$ Commented May 26, 2020 at 11:41
  • 3
    $\begingroup$ it works OK on my end. exported OK, opened image using paint.exe, all ok. So have no idea why it fails for you. May be problem with V 9. I do not have that on my PC now to try it. $\endgroup$ Commented May 26, 2020 at 11:47
  • $\begingroup$ Try wrapping the plot with Image[...] and removing the alpha channel, then exporting it. image = RemoveAlphaChannel[Image[Plot[x, {x, 0, 1}]], White] $\endgroup$ Commented May 26, 2020 at 13:10
  • $\begingroup$ @flinty I tried your suggestion, but the problem remained the same. $\endgroup$ Commented May 26, 2020 at 18:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.