'Save generated frames from pil as a gif faster

So here is my question i generated a gif using pillow library it took about .4 seconds to have all the frames appended in a list. And when i further saved it using the following code

frames[0].save('test.gif', save_all=True, duration=45, loop=0, append_images=frames[1:])

it takes about 3 seconds to save and output the image. So is there a way to do it faster the gif has around 100-120 frames. I am open to using third party libs or any way to generate the gif faster. Also it would be helpful if someone would take a look at my gif code preferably in dms and give pointers on optimizing it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source