Search code examples
pythonpython-3.xpython-imageio

imageio - ValueError: Could not find a format to read the specified file in mode 'i'


I have a series of SVG images (generated from matplotlib) and I want to combine them into a GIF image.

Since I read this question, I tried imageio, but it raised ValueError: Could not find a format to read the specified file in mode 'i' at imread(str(i)+'.svg') part. How to fix this?


Solution

  • SVG is a vector format, and is not supported by imageio: type imageio.help() to display all supported formats.

    You'll need to use an svg to bitmap converter first (rasterize the image, this will let you choose the image's quality). Or even better, look if there's a native way to make SVG animations (google finds a few tutorials on this subject).