by @anthropic
A toolkit from Anthropic for creating animated GIFs optimized for Slack. Includes easing functions for smooth animations (bounce, elastic, back), frame composition helpers, and comprehensive animation concepts. Claude writes custom animation code using PIL primitives and imageio.
A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.
Dimensions:
Parameters:
from PIL import Image, ImageDraw
import imageio
import numpy as np
# 1. Create frames
frames = []
width, height = 128, 128
for i in range(12):
frame = Image.new('RGB', (width, height), (240, 248, 255))
draw = ImageDraw.Draw(frame)
# Draw your animation using PIL primitives
frames.append(np.array(frame))
# 2. Save with optimization
imageio.mimsave('output.gif', frames, duration=1/10, loop=0)
If a user uploads an image, consider whether they want to:
Use PIL ImageDraw primitives:
from PIL import ImageDraw
draw = ImageDraw.Draw(frame)
# Circles/ovals
draw.ellipse([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)
# Stars, triangles, any polygon
points = [(x1, y1), (x2, y2), (x3, y3)]
draw.polygon(points, fill=(r, g, b), outline=(r, g, b), width=3)
# Lines
draw.line([(x1, y1), (x2, y2)], fill=(r, g, b), width=5)
# Rectangles
draw.rectangle([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)
Don't use: Emoji fonts (unreliable across platforms) or assume pre-packaged graphics exist.
Use thicker lines - Always set width=2 or higher. Thin lines (width=1) look choppy.
Add visual depth:
Make shapes more interesting: