For a compact, cleaner-looking GIF on a Mac, trim the video to the moment you need, choose an output frame rate and width, then use FFmpeg’s palettegen and paletteuse filters to build and apply a palette from those frames. A two-pass conversion makes it straightforward to adjust the settings and inspect the result.
Install FFmpeg on macOS
If FFmpeg is not already installed, Homebrew documents this installation command:
As an Amazon Associate I earn from qualifying purchases.
brew install ffmpeg
ffmpeg -version
The first command installs FFmpeg; the second prints the installed version. Homebrew’s formula and macOS bottle availability can change, so check the FFmpeg Homebrew formula if you need current package or platform details.
Convert a trimmed video with a two-pass palette workflow
This example starts five seconds into input.mp4, converts three seconds at 12 frames per second, and scales the output to 480 pixels wide while preserving the aspect ratio. Replace the filename and adjust the timing and dimensions for your clip.
#1 Best Overall
- SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
- HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
- APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
ffmpeg -ss 5 -t 3 -i input.mp4
-vf "fps=12,scale=480:-1:flags=lanczos,palettegen"
palette.png
ffmpeg -ss 5 -t 3 -i input.mp4 -i palette.png
-lavfi "fps=12,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse"
-loop 0 output.gif
- Generate the palette. The first command selects the excerpt, sets the frame rate and width, then writes a palette image named
palette.png. - Encode the GIF. The second command processes the same excerpt with the same frame-rate and scaling settings, applies the palette, and writes
output.gif. The-loop 0option requests continuous looping.
Matching frame selection, frame rate and scaling in both passes helps ensure that the palette is generated for the frames used in the GIF. These are adjustable example settings, not universal quality or size recommendations. FFmpeg documents this palette workflow in its filter reference.
Use a one-command alternative
FFmpeg can generate and apply the palette within one filter graph:
Rank #2
- FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
- BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
- MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
ffmpeg -ss 5 -t 3 -i input.mp4
-filter_complex "[0:v]fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse"
-loop 0 output.gif
The split filter sends the selected, scaled frames down two paths: one generates the palette, and the other uses it to create the GIF. If you are troubleshooting filter-graph quoting or want to change settings in stages, use the two-pass commands first.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Choose settings for the right balance of size and appearance
There is no single setting that minimizes file size while preserving every detail. Compare the resulting file’s size and appearance at its intended display size.
Rank #3
- FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
- BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
- MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
| Setting | What it changes | How to tune it |
|---|---|---|
| Clip duration | The amount of motion and number of frames in the GIF. | Keep only the essential action; a shorter excerpt generally contains fewer frames. |
| Frame rate | Motion smoothness and frame count. | Use the lowest rate that still communicates the action. Reduce it to cut frames, or raise it if motion looks too choppy. |
| Dimensions | Pixel detail and output data. | In scale=480:-1, 480 sets the width in pixels and -1 lets FFmpeg calculate a proportional height. Choose a width appropriate for the display destination. |
| Palette | How source colors are mapped into the GIF’s limited palette. | palettegen builds a palette from the video frames. Its max_colors option can lower the color count, at the cost of color detail. |
| Dithering | How color transitions and texture appear after palette mapping. | Compare the result on your clip. FFmpeg documents several methods, including Bayer, Floyd–Steinberg, Sierra, Atkinson, Burkes and no dithering; its documented default is sierra2_4a. |
For a smaller-dimension, lower-frame-rate starting point, use fps=8,scale=320:-1:flags=lanczos in both passes. Smaller dimensions or fewer frames usually reduce output data, but can make motion less smooth or details harder to read. Check the encoded file rather than assuming a specific size reduction.
Adjust palette behavior for changing scenes
For clips with substantial movement or changing areas, FFmpeg offers palette options that alter how frames contribute to palette generation and application. palettegen=stats_mode=diff gives more weight to areas that change between frames. paletteuse=diff_mode=rectangle limits processing to the changing rectangle; FFmpeg notes that this can help speed and compression in relevant clips, particularly with error-diffusion dithering. Neither setting is guaranteed to improve every GIF, so compare the output with and without them.
Rank #4
- SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
- HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
- APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
Understand color and transparency limits
GIF uses a palette of up to 256 colors. FFmpeg describes its palette as a 256-pixel image; unused palette entries are black. By default, palettegen reserves the last entry for transparency, which limits generated colors to 255. If transparency matters, paletteuse also provides an alpha_threshold setting to determine which alpha values become transparent or opaque.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →GIF transparency is not continuous, full-range partial transparency. Soft translucent edges from a source video may therefore look different when converted. Inspect edges against the background where the GIF will be displayed.
Quick Recap
Best Value
- SUPERCHARGED BY M5 — The 14-inch MacBook Pro with M5 brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. Featuring all-day battery life and a breathtaking Liquid Retina XDR display with up to 1600 nits peak brightness, it’s pro in every way.*
- HAPPILY EVER FASTER — Along with its faster CPU and unified memory, M5 features a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR APPLE INTELLIGENCE — Apple Intelligence is the personal intelligence system that helps you write, express yourself, and get things done effortlessly. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.
- APPS FLY WITH APPLE SILICON — All your favorites, including Microsoft 365 and Adobe Creative Cloud, run lightning fast in macOS.*
Check the output before sharing it
- Confirm that the GIF shows the intended excerpt and loops as expected.
- Check that text, faces or other important details remain readable at the intended display size.
- Compare file size, dimensions, frame rate, motion smoothness, color banding and dithering texture.
- If the file is too large, shorten the excerpt, lower the frame rate or reduce the width, changing one setting at a time so you can see the trade-off.
- If gradients or edges look poor, compare dithering choices and inspect whether transparency is needed.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




