--- tags: Python, Pillow --- # Python Pillow common ### Save to gif ```python from PIL import Image import numpy as np imgs = list() for i in range(10): img = np.arange(300, dtype=np.uint8).reshape(10, 10, 3) img = np.clip(img, 0, 255) img = Image.fromarray(img) imgs.append(img) # loop=0 will repeat always imgs[0].save('test.gif', format='GIF', append_images=imgs[1:], save_all=True, duration=100, loop=0) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up