cn-slack-gif-creator

Slack GIF creator knowledge and utilities: provides methods and practical tools for creating animated GIFs optimized for Slack.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "cn-slack-gif-creator" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-337afd8a6bf7ed3342a27696ec544e79885fe25498800ab4cfd317a135be3905. Verify the upstream source and version against https://skillhub.cn/skills/org-02qudk26/cn-slack-gif-creator before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Slack GIF creator knowledge and utilities: provides methods and practical tools for creating animated GIFs optimized for Slack.

0 Downloads

Introduction source: third_party · org-02qudk26 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: "slack-gif-creator"
description: "创建针对 Slack 优化的动画 GIF 的知识和实用程序。提供约束、验证工具和动画概念。当用户请求 Slack 的动画 GIF 时使用,例如“让我成为 X 为 Slack 做 Y 的 GIF。"
license: "\"Complete terms in LICENSE.txt\""
displayName: "Slack Gif 创建者"
summary: "创建针对 Slack 优化的动画 GIF 的知识和实用程序"
version: 1.0.0
tags: [松弛, 动画, 动图, 知识, Slack]

Slack GIF 创作者

一个工具包,提供用于创建针对 Slack 优化的动画 GIF 的实用程序和知识。

Slack 要求

尺寸:

  • 表情符号 GIF:128x128(推荐)
  • 消息 GIF:480x480

参数:

  • FPS:10-30(越低文件大小越小)
  • 颜色:48-128(越少=文件大小越小)
  • 持续时间:表情符号 GIF 的持续时间保持在 3 秒以内

核心工作流程

块0块

绘制图形

使用用户上传的图像

如果用户上传图像,请考虑他们是否想要:

  • 直接使用它(例如,“动画化它”,“将其分割成帧”)
  • 用它作为灵感(例如,“做这样的东西”)

使用 PIL 加载和处理图像: 块1块

从头开始绘图

从头开始绘制图形时,请使用 PIL ImageDraw 原语:

块2块

不要使用: 表情符号字体(跨平台不可靠)或假设此技能中存在预先打包的图形。

让图形看起来更好

图形应该看起来精致且富有创意,而不是简单的。方法如下:

使用较粗的线条 - 始终将轮廓和线条设置为 width=2 或更高。细线(宽度=1)看起来不稳定且业余。

添加视觉深度:

  • 使用渐变背景(create_gradient_background)
  • 分层多个形状以实现复杂性(例如,内部有较小星星的星星)

让形状更有趣:

  • 不要只画一个简单的圆圈 - 添加高光、圆环或图案
  • 星星可以发光(在后面绘制更大的半透明版本)
  • 组合多种形状(星星+闪光、圆形+戒指)

注意颜色:

  • 使用充满活力的互补色
  • 添加对比度(浅色形状上的深色轮廓,深色形状上的浅色轮廓)
  • 考虑整体构成

对于复杂形状(心形、雪花等):

  • 使用多边形和椭圆的组合
  • 仔细计算点的对称性
  • 添加细节(心可以有高光曲线,雪花有复杂的树枝)

要有创意和细节!好的 Slack GIF 应该看起来很抛光,而不是像占位符图形。

可用的实用程序

GIFBuilder (core.gif_builder)

组装框架并针对 Slack 进行优化: 块3块

验证器 (core.validators)

检查GIF是否满足Slack要求:

from core.validators import validate_gif, is_slack_ready

# Detailed validation
passes, info = validate_gif('my.gif', is_emoji=True, verbose=True)

# Quick check
if is_slack_ready('my.gif'):
    print("Ready!")

缓动函数 (core.easing)

平滑运动而不是线性运动:

from core.easing import interpolate

# Progress from 0.0 to 1.0
t = i / (num_frames - 1)

# Apply easing
y = interpolate(start=0, end=400, t=t, easing='ease_out')

# Available: linear, ease_in, ease_out, ease_in_out,
#           bounce_out, elastic_out, back_out

框架助手 (core.frame_composer)

满足常见需求的便捷功能:

from core.frame_composer import (
    create_blank_frame,         # Solid color background
    create_gradient_background,  # Vertical gradient
    draw_circle,                # Helper for circles
    draw_text,                  # Simple text rendering
    draw_star                   # 5-pointed star
)

动画概念

摇动/振动

通过振荡偏移物体位置:

  • 使用带有框架索引的 math.sin() 或 math.cos()
  • 添加小的随机变化以获得自然的感觉
  • 适用于 x 和/或 y 位置

脉搏/心跳

有节奏地缩放对象大小:

  • 使用 math.sin(t * frequency * 2 * math.pi) 实现平滑脉冲
  • 对于心跳:两个快速脉冲然后暂停(调整正弦波)
  • 基础尺寸的比例在 0.8 到 1.2 之间

弹跳

物体下落和弹起:

  • 使用interpolate()与easing='bounce_out'着陆
  • 使用easing='ease_in'进行坠落(加速)
  • 通过增加每帧的 y 速度来应用重力

旋转/旋转

绕中心旋转对象:

  • 太平船务:image.rotate(angle, resample=Image.BICUBIC)
  • 对于摆动:使用正弦波作为角度而不是线性

淡入/淡出

逐渐出现或消失:

  • 创建 RGBA 图像,调整 Alpha 通道
  • 或使用Image.blend(image1, image2, alpha)
  • 淡入:alpha 从 0 到 1
  • 淡出:alpha 从 1 到 0

幻灯片

将对象从屏幕外移动到以下位置:

  • 起始位置:框架边界外
  • 结束位置:目标位置
  • 使用 interpolate() 与 easing='ease_out' 实现平稳停止
  • 对于过冲:使用easing='back_out'

缩放

缩放效果的比例和位置:

  • 放大:比例从 0.1 到 2.0,裁剪中心
  • 缩小:从 2.0 缩放到 1.0
  • 可以为戏剧添加运动模糊(PIL 过滤器)

爆炸/粒子爆发

创建向外辐射的粒子:

  • 生成具有随机角度和速度的粒子
  • 更新每个粒子:x += vx、y += vy
  • 添加重力:vy += gravity_constant
  • 随着时间的推移逐渐淡出粒子(减少 Alpha)

优化策略

仅当要求减小文件大小时,才实施以下一些方法:

  1. 更少的帧 - 较低的 FPS(10 而不是 20)或较短的持续时间
  2. 更少的颜色 - num_colors=48 而不是 128
  3. 较小尺寸 - 128x128 而不是 480x480
  4. 删除重复项 - save() 中的 remove_duplicates=True
  5. 表情符号模式 - optimize_for_emoji=True 自动优化
# Maximum optimization for emoji
builder.save(
    'emoji.gif',
    num_colors=48,
    optimize_for_emoji=True,
    remove_duplicates=True
)

理念

该技能提供:

  • 知识:Slack的要求和动画概念
  • 实用程序:GIFBuilder、验证器、缓动函数
  • 灵活性:使用 PIL 原语创建动画逻辑

它不提供:

  • 刚性动画模板或预制功能
  • 表情符号字体渲染(跨平台不可靠)
  • 技能中内置的预打包图形库

关于用户上传的注意事项:此技能不包括预先构建的图形,但如果用户上传图像,请使用 PIL 来加载和使用它 - 根据他们的请求进行解释,无论他们希望直接使用它还是只是作为灵感。

有创意!结合概念(弹跳 + 旋转、脉冲 + 滑动等)并使用 PIL 的全部功能。

依赖关系

pip install pillow imageio numpy

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供完整的 Slack GIF 创建知识体系和实用工具
  • 解决用户在 Slack 平台制作动画表情符号和消息 GIF 的具体需求
  • 涵盖从图形绘制到动画概念再到优化策略的全流程指导
Trigger Precision88/100

Highlights

  • 触发场景描述清晰明确,覆盖用户典型使用场景
  • 提供了具体的触发示例,边界清晰
Structure and Standards92/100

Highlights

  • 文档结构完整,章节划分清晰
  • 包含详细的代码示例和端到端说明
  • frontmatter 完整,标签设置合理
Execution Reliability87/100

Highlights

  • 工具来源明确,依赖清晰
  • 参数说明详细,覆盖主要使用场景
  • 提供了验证工具和优化策略
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Save or modify files

    Confirm the output directory and whether existing files will be replaced. Back up important files and prefer a new output directory.

    Mentioned in main document · lines 183
  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 210

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.