1Initialize GIFBuilder: — Set width, height, and frames per second (FPS) based on user request and Slack's requirements.
2Generate Frames: — Create individual frames using PIL, drawing graphics or incorporating user-provided images.
3Apply Animation: — Implement animation concepts like shake, pulse, bounce, spin, fade, slide, zoom, or explode using easing functions and frame manipulation.
4Optimize GIF: — Reduce file size by adjusting the number of colors, dimensions, and removing duplicate frames.
5Validate GIF: — Check if the GIF meets Slack's requirements using the provided validators.
6Save GIF: — Save the optimized GIF using GIFBuilder with appropriate settings for emoji or message GIFs.
7Provide Output: — Return the generated GIF file to the user.