4

I have a set of transparent png files and i want to create an animated gif with transparent background.

For the moment, i am able to produce the animated gif with a fully black background. I am sure it is not transparent as i am visualizing the animated gif on a colored web page.

The code i am using is based on image.io:

def GenerateAnimatedGIF(filePath, maxFile, outputFile):
with imageio.get_writer(outputFile, mode='I', duration=0.5) as writer:
    for  Counter in range(1,maxFile):
        filename = os.path.join(filePath,'snapshot' + str(Counter).zfill(2) +'.png')
        print filename
        image = imageio.imread(filename)
        writer.append_data(image)

Any help is welcome!

Using http://www.online-image-editor.com/ i see it is possible to remove the set the background of the animated gif transparent. Now how to do it programmatically ?

alvaro562003
  • 678
  • 1
  • 6
  • 27
  • see : https://stackoverflow.com/questions/46850318/transparent-background-in-gif-using-python-imageio – FelixHo Aug 28 '20 at 02:17

0 Answers0