I want to make script which liquid-rescales GIFs frame by frame, but I stuck into the problem. Every time it just distorts image, and it looks like previous frame isnt disposed. I used this answer as base for my script:
In [19]: with Image() as result:
...: with Image(filename='file.gif') as source:
...: for frame in source.sequence:
...: x, y = frame.width, frame.height
...: frame.liquid_rescale(x//2, y//2)
...: frame.resize(x, y)
...: result.sequence.append(frame)
...: result.save(filename='res.gif')
Here is source image: http://maxlunar.insomnia247.nl/files/file.gif
And my result image: http://maxlunar.insomnia247.nl/files/res.gif
I'm not sure how do I fix that mess. Also I plan to do all manipulations with images in memory (I download them from URLs right into io.BytesIO
object, and this is required because I plan to use it in multithreaded application, so it should be thread/process-safe). Thanks in advance.