soiz commited on
Commit
51e5e37
·
verified ·
1 Parent(s): 5adb495

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from PIL import Image, ImageSequence
2
+
3
+ gif = Image.open('example.gif')
4
+ frames = []
5
+
6
+ for frame in ImageSequence.Iterator(gif):
7
+ frame = frame.convert("RGBA")
8
+ # 編集処理例: サイズ変更
9
+ frame = frame.resize((100, 100))
10
+ frames.append(frame)
11
+
12
+ frames[0].save('edited.gif', save_all=True, append_images=frames[1:], loop=0, duration=gif.info['duration'])