Create Optimized GIFs for Slack
Toolkit and animation know-how for building custom Slack emoji and message GIFs with PIL, correctly sized and optimized.
Why it matters
Generate animated GIFs specifically optimized for Slack, adhering to dimension, FPS, and color count requirements. This skill provides the tools and knowledge to create visually appealing and efficient GIFs for messaging and emoji use.
Outcomes
What it gets done
Create animated GIF frames using PIL primitives or user-uploaded images.
Optimize GIFs for Slack by adjusting dimensions, FPS, and color count.
Utilize easing functions for smooth animation transitions.
Validate GIF output against Slack's technical requirements.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-slack-gif-creator | bash Overview
Slack GIF Creator
A toolkit for creating Slack-optimized animated GIFs: correct dimension/FPS/color/duration requirements, a GIFBuilder and validator workflow using PIL primitives, easing functions, and documented animation concepts like bounce, pulse, spin, and particle bursts. Use when building a Slack emoji or message GIF from scratch or an uploaded image; not needed when pre-made emoji fonts or graphics already suffice.
What it does
A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack, covering Slack's dimension, FPS, color, and duration requirements - 128x128 for emoji, 480x480 for message GIFs, 10-30 FPS, 48-128 colors, under 3 seconds for emoji - a core GIFBuilder/ImageDraw workflow for generating and saving frames, and a library of animation concepts including shake, pulse, bounce, spin, fade, slide, zoom, and particle explosion.
When to use - and when NOT to
Use this when creating a Slack emoji or message GIF from scratch or from a user-uploaded image, needing correct Slack sizing/color/FPS constraints, or implementing a specific animation effect like bounce, pulse, or particle burst.
Not needed for GIFs outside Slack's constraints, or when pre-made emoji fonts or graphics would suffice - this skill deliberately avoids emoji fonts, which are unreliable across platforms, and doesn't ship pre-packaged graphics.
Inputs and outputs
Core workflow: create a GIFBuilder(width, height, fps), generate frames with PIL's Image/ImageDraw primitives - ellipses, polygons, lines, rectangles - add each frame, then save with optimization (num_colors, optimize_for_emoji, remove_duplicates). User-uploaded images are loaded with PIL and used either directly or as style/color inspiration, based on the request.
### 1. Create builder
builder = GIFBuilder(width=128, height=128, fps=10)
### 2. Generate frames
for i in range(12):
frame = Image.new('RGB', (128, 128), (240, 248, 255))
draw = ImageDraw.Draw(frame)
# Draw your animation using PIL primitives
# (circles, polygons, lines, etc.)
builder.add_frame(frame)
### 3. Save with optimization
builder.save('output.gif', num_colors=48, optimize_for_emoji=True)
Integrations
Provided utilities: core.gif_builder.GIFBuilder assembles and optimizes frames; core.validators offers validate_gif/is_slack_ready to check Slack compliance; core.easing provides interpolate with linear, ease_in, ease_out, ease_in_out, bounce_out, elastic_out, and back_out modes for smooth motion instead of linear; and core.frame_composer supplies helpers like create_blank_frame, create_gradient_background, draw_circle, draw_text, and draw_star. Animation concepts documented with implementation notes: shake/vibrate via sine or cosine oscillation, pulse/heartbeat via sine-wave scaling, bounce via bounce_out/ease_in easing with gravity, spin via PIL's rotate, fade in/out via alpha blending, slide via ease_out/back_out easing, zoom via scale plus crop with optional motion blur, and particle bursts via velocity, gravity, and fading alpha. Optimization strategies, applied only when file size needs reducing, include lower FPS, fewer colors, smaller dimensions, remove_duplicates=True, and optimize_for_emoji=True. Requires pip install pillow imageio numpy.
Graphics should look polished rather than basic: use thicker outline widths instead of width=1, add visual depth with gradients and layered shapes, make simple shapes more interesting with highlights and glows, and pay attention to vibrant, contrasting color choices.
Who it's for
Developers building custom Slack emoji or message GIFs who want Slack's exact constraints plus composable animation-building utilities, rather than a fixed template library.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.