Slack GIF Creator
Create animated GIFs optimized for Slack with proper dimensions, frame rates, and file sizes.
Prerequisites
- Python with Pillow, imageio, numpy
- Understanding of animation concepts
Instructions
Slack Requirements
| Type |
Dimensions |
FPS |
Colors |
Duration |
| Emoji |
128x128 |
10-30 |
48-128 |
<3 sec |
| Message |
480x480 |
10-30 |
48-128 |
flexible |
Core Workflow
from core.gif_builder import GIFBuilder
from PIL import Image, ImageDraw
builder = GIFBuilder(width=128, height=128, fps=10)
for i in range(12):
frame = Image.new('RGB', (128, 128), (240, 248, 255))
draw = ImageDraw.Draw(frame)
# Draw animation using PIL primitives
builder.add_frame(frame)
builder.save('output.gif', num_colors=48, optimize_for_emoji=True)
Drawing Graphics
draw = ImageDraw.Draw(frame)
draw.ellipse([x1, y1, x2, y2], fill=(r,g,b), width=3) # Circles
draw.polygon(points, fill=(r,g,b), width=3) # Polygons
draw.line([(x1,y1), (x2,y2)], fill=(r,g,b), width=5) # Lines
draw.rectangle([x1,y1,x2,y2], fill=(r,g,b), width=3) # Rectangles
Animation Concepts
- Shake: Use
math.sin()/math.cos() for oscillation
- Pulse: Scale size with sine wave (0.8 to 1.2)
- Bounce: Use
easing='bounce_out' for landing
- Spin:
image.rotate(angle, resample=Image.BICUBIC)
- Fade: Adjust alpha channel or use
Image.blend()
- Slide: Move from off-screen with
easing='ease_out'
Making Graphics Look Good
- Use thicker lines (
width=2 or higher)
- Add visual depth with gradients
- Layer multiple shapes for complexity
- Use vibrant, complementary colors
- Add contrast (dark outlines on light shapes)
Error Handling
- If file size too large, reduce colors/frames/dimensions
- Don't use emoji fonts (unreliable across platforms)
- Test GIF in Slack before finalizing
Notes
- Utilities: GIFBuilder, validators, easing functions
- Easing options: linear, ease_in, ease_out, bounce_out, elastic_out
- Combine concepts: bouncing + rotating, pulsing + sliding
Source: anthropics/skills
1---2name: slack-gif-creator3description: Slack GIF Creator4---5# Slack GIF Creator67Create animated GIFs optimized for Slack with proper dimensions, frame rates, and file sizes.89## Prerequisites1011- Python with Pillow, imageio, numpy12- Understanding of animation concepts1314## Instructions1516### Slack Requirements1718| Type | Dimensions | FPS | Colors | Duration |19|------|------------|-----|--------|----------|20| Emoji | 128x128 | 10-30 | 48-128 | <3 sec |21| Message | 480x480 | 10-30 | 48-128 | flexible |2223### Core Workflow2425```python26from core.gif_builder import GIFBuilder27from PIL import Image, ImageDraw2829builder = GIFBuilder(width=128, height=128, fps=10)3031for i in range(12):32 frame = Image.new('RGB', (128, 128), (240, 248, 255))33 draw = ImageDraw.Draw(frame)34 # Draw animation using PIL primitives35 builder.add_frame(frame)3637builder.save('output.gif', num_colors=48, optimize_for_emoji=True)38```3940### Drawing Graphics4142```python43draw = ImageDraw.Draw(frame)44draw.ellipse([x1, y1, x2, y2], fill=(r,g,b), width=3) # Circles45draw.polygon(points, fill=(r,g,b), width=3) # Polygons46draw.line([(x1,y1), (x2,y2)], fill=(r,g,b), width=5) # Lines47draw.rectangle([x1,y1,x2,y2], fill=(r,g,b), width=3) # Rectangles48```4950### Animation Concepts5152- **Shake**: Use `math.sin()`/`math.cos()` for oscillation53- **Pulse**: Scale size with sine wave (0.8 to 1.2)54- **Bounce**: Use `easing='bounce_out'` for landing55- **Spin**: `image.rotate(angle, resample=Image.BICUBIC)`56- **Fade**: Adjust alpha channel or use `Image.blend()`57- **Slide**: Move from off-screen with `easing='ease_out'`5859### Making Graphics Look Good6061- Use thicker lines (`width=2` or higher)62- Add visual depth with gradients63- Layer multiple shapes for complexity64- Use vibrant, complementary colors65- Add contrast (dark outlines on light shapes)6667## Error Handling6869- If file size too large, reduce colors/frames/dimensions70- Don't use emoji fonts (unreliable across platforms)71- Test GIF in Slack before finalizing7273## Notes7475- Utilities: GIFBuilder, validators, easing functions76- Easing options: linear, ease_in, ease_out, bounce_out, elastic_out77- Combine concepts: bouncing + rotating, pulsing + sliding7879Source: anthropics/skills