Start from the ending
Before importing anything, decide where the GIF is going. A GIF for a README, a Slack reaction, an email newsletter and a Twitter post have different size budgets and different sensible dimensions, and every later decision follows from that one.
The two numbers to fix first are the width and the length in seconds. Width sets the pixel count, which drives file size more than any encoder setting; length sets the frame count, which drives it almost as hard. A four-second clip at 480 px wide is a comfortable target for most destinations. Ten seconds at 800 px is not, and no amount of tuning will make it one.
| Destination | Width | Length | Budget |
|---|---|---|---|
| README / docs | 600–800 px | 5–15 s | Under 5 MB |
| Slack, Discord | 400–600 px | 2–6 s | Under 2 MB |
| Email newsletter | 480–600 px | 2–4 s | Under 1 MB |
| Twitter / X | 480–640 px | 2–6 s | Under 15 MB |
Email is the tight one. Many clients show only the first frame, so put the message in frame one and treat the animation as a bonus.