In the Skill's Own Terms
A toolkit for creating animated GIFs optimized for Slack's size and dimension requirements. Provides a GIFBuilder for assembling frames, validators to check Slack compliance, easing functions for smooth motion, and frame helpers for common drawing tasks. Designed for emoji GIFs (128×128, under 3 seconds) and message GIFs (480×480).
Uses PIL ImageDraw primitives to create graphics from scratch or work with user-uploaded images. Includes animation concepts like bounce, pulse, spin, fade, and particle bursts. Focuses on producing polished, creative graphics with proper line weights, visual depth, and color contrast rather than basic placeholder shapes.
How It Works
- 01Create a GIFBuilder
Initialize with target dimensions (128×128 for emoji or 480×480 for messages) and frame rate between 10-30 FPS, where lower rates produce smaller file sizes.
- 02Generate Frames with PIL Primitives
Draw each frame using PIL's ImageDraw ellipses, polygons, lines and rectangles.
- 03Apply Easing Functions for Smooth Motion
Use interpolate with easing curves like ease_out, bounce_out, elastic_out or back_out instead of linear motion to create natural-feeling animations.
- 04Add Frames to the Builder
Call add_frame for each PIL Image or add_frames for a list. The builder accumulates all frames before export.
- 05Save with Slack Optimization
Export with num_colors between 48-128 (fewer colors reduce file size), optimize_for_emoji=True for automatic optimization, and remove_duplicates=True to eliminate redundant frames.
- 06Validate Against Slack Requirements
Use validate_gif for detailed feedback or is_slack_ready for a quick pass/fail check to confirm the GIF meets dimension, size and parameter constraints.