Create GIF From Images: CLI and GUI Methods That Work
You have a folder of images. Maybe they are product shots for an e-commerce listing, frames from a screen recording, slides from a tutorial, or hand-drawn frames for a pixel-art animation. You want to stitch them into an animated GIF.
The process is straightforward: name your files sequentially, pick a frame rate, run a command, and optimize the output. But the details matter -- wrong dimensions produce stretched frames, wrong palette settings produce banded gradients, and wrong frame rates make your animation feel sluggish or frantic.
This guide covers how to create a GIF from images using command-line tools (FFmpeg 7.0 and ImageMagick 7.1), desktop editors (GIMP and Photoshop), and the browser-based option ezgif. Before you assemble anything, you will want your source images at consistent dimensions and file sizes -- Pixotter's resize tool handles batch resizing in your browser with no upload, and the compression tool strips unnecessary weight from each frame before assembly.
Jump to: FFmpeg method | ImageMagick method | Preparing images | Optimizing the result | FAQ
Choosing the Right Tool
Not every tool handles the job the same way. FFmpeg gives you the most control over palette generation and frame timing. ImageMagick is simpler for basic assembly. GUI tools trade flexibility for convenience.
| Method | Max Images | Frame Rate Control | Optimization | Platform | Cost |
|---|---|---|---|---|---|
| FFmpeg 7.0 | Unlimited | Per-frame timing via PTS | Palette generation + dithering | Windows, macOS, Linux | Free (LGPL/GPL) |
| ImageMagick 7.1 | Unlimited (RAM-limited) | Global delay per frame | Basic LZW optimization | Windows, macOS, Linux | Free (Apache 2.0) |
| GIMP 2.10.36 | RAM-limited | Per-layer delay tags | Export-time optimization | Windows, macOS, Linux | Free (GPLv3) |
| Photoshop | 500 (timeline limit) | Per-frame in timeline | Save for Web optimization | Windows, macOS | $22.99/mo |
| ezgif.com | 2,000 | Global delay slider | Lossy + color reduction | Browser | Free (with ads, 100 MB limit) |
FFmpeg is the right choice for most workflows. It handles thousands of frames, produces the sharpest output thanks to its two-pass palette generation, and integrates into automated pipelines. ImageMagick works well for quick one-off assembly when you do not need precise palette control.
Try it yourself
Reduce file size without visible quality loss — free, instant, no signup. Your images never leave your browser.
FFmpeg 7.0: The Fastest CLI Method
FFmpeg is the industry-standard multimedia tool. Creating a GIF from images requires two passes: one to generate an optimal color palette, and one to apply that palette while encoding.
Install FFmpeg 7.0
# macOS (Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows (winget)
winget install Gyan.FFmpeg
# Verify version
ffmpeg -version
# Expected: ffmpeg version 7.0.x
Basic: Create a GIF at 10 fps
Assume your images are named frame_001.png, frame_002.png, etc., in a single directory.
# Step 1: Generate the palette
ffmpeg -framerate 10 -i frame_%03d.png -vf "palettegen=max_colors=256:stats_mode=diff" palette.png
# Step 2: Encode the GIF using the palette
ffmpeg -framerate 10 -i frame_%03d.png -i palette.png -lavfi "paletteuse=dither=floyd_steinberg" output.gif
What this does:
-framerate 10sets 10 frames per second (100 ms between frames). Adjust to taste.-i frame_%03d.pngreads sequentially numbered files.%03dmatches001,002, ...999.palettegenanalyzes all frames and builds the best possible 256-color palette.stats_mode=diffweights colors by how often they appear across frame transitions, which prioritizes moving content.paletteusemaps each frame to that palette.dither=floyd_steinbergapplies Floyd-Steinberg dithering to smooth color transitions.
Advanced: Custom resolution and looping
# Scale to 480px wide (height auto-calculated), loop infinitely
ffmpeg -framerate 15 -i frame_%03d.png \
-vf "scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=256:stats_mode=diff[p];[s1][p]paletteuse=dither=floyd_steinberg" \
-loop 0 output.gif
This single command handles both palette generation and encoding in one pass by using the split filter. -loop 0 means infinite looping (use -loop 1 for a single play).
Non-sequential filenames
If your files are not sequentially numbered, create a text file listing them:
# Create input list
ls *.png | sort | while read f; do echo "file '$f'"; done > filelist.txt
# Use concat demuxer
ffmpeg -f concat -safe 0 -r 10 -i filelist.txt -vf "palettegen=max_colors=256" palette.png
ffmpeg -f concat -safe 0 -r 10 -i filelist.txt -i palette.png -lavfi "paletteuse=dither=floyd_steinberg" output.gif
ImageMagick 7.1: One-Command Assembly
ImageMagick is simpler for basic GIF creation. The trade-off: it does not have FFmpeg's palette optimization, so output files tend to be larger and colors less accurate for photographic content.
Install ImageMagick 7.1
# macOS (Homebrew)
brew install imagemagick
# Ubuntu/Debian
sudo apt install imagemagick
# Windows (winget)
winget install ImageMagick.ImageMagick
# Verify version (note: ImageMagick 7 uses 'magick', not 'convert')
magick --version
# Expected: ImageMagick 7.1.x
Basic: Create a GIF from PNG files
# 100ms delay between frames (10 fps), infinite loop
magick -delay 10 -loop 0 frame_*.png output.gif
Key detail: ImageMagick's -delay value is in hundredths of a second. So -delay 10 = 100 ms = 10 fps. -delay 5 = 50 ms = 20 fps.
With optimization
# Resize to 480px wide, optimize frame encoding, reduce colors
magick -delay 10 -loop 0 frame_*.png \
-resize 480x \
-layers OptimizePlus \
-colors 128 \
output.gif
-layers OptimizePlusenables inter-frame optimization (stores only changed pixels between frames).-colors 128reduces the palette from 256 to 128 colors, shrinking file size at a small quality cost.
From JPEG sources
JPEG images introduce compression artifacts that create noisy GIF output. Pre-process them:
# Resize, reduce noise, then assemble
magick -delay 10 -loop 0 photo_*.jpg \
-resize 480x \
-enhance \
-layers OptimizePlus \
output.gif
For better results on photographic content, consider converting your final GIF to MP4 instead -- video codecs handle gradients and photographic detail far better than GIF's 256-color limit. See our guide on converting GIF to MP4.
GUI Methods: GIMP and Photoshop
GIMP 2.10.36
GIMP treats each layer as a frame. The workflow:
- Open your first image: File > Open.
- Add remaining images as layers: File > Open as Layers. Select all your frame images.
- Set frame timing: Rename each layer to include the delay in parentheses, e.g.,
frame_001 (100ms). GIMP reads these tags during export. - Preview the animation: Filters > Animation > Playback.
- Export: File > Export As > choose
.gif. In the export dialog, check "As animation" and set the default delay.
GIMP works well for small animations (under 50 frames) but becomes tedious at scale. For anything with more than a handful of frames, the command-line tools save significant time.
Photoshop (Timeline method)
- File > Scripts > Load Files into Stack. Select your images.
- Window > Timeline. Click "Create Frame Animation."
- From the timeline menu, select "Make Frames From Layers."
- Set the delay for each frame (or select all and set uniformly).
- File > Export > Save for Web (Legacy). Choose GIF, adjust colors and dithering.
Photoshop caps at 500 frames and the Save for Web dialog is notoriously slow on large animations. If you already have a Photoshop license, it works fine for small projects. For automated pipelines or anything over 100 frames, FFmpeg is the better tool.
ezgif.com (Browser)
Upload up to 2,000 images (total under 100 MB) at ezgif.com/maker. Set frame delay, drag to reorder, and download the result. It works, but your images are uploaded to their servers, you are limited to 100 MB total, and the optimization controls are basic. For a privacy-first approach to image preparation, Pixotter's tools process everything in your browser -- nothing leaves your machine.
Preparing Images for GIF Assembly
The quality of your GIF depends more on preparation than on the encoding tool. Skipping prep is the most common reason GIFs look broken.
1. Consistent dimensions
Every frame must have identical width and height. If frame 001 is 1920x1080 and frame 014 is 1280x720, the GIF encoder will either stretch, crop, or pad the mismatched frame. None of those look good.
Use Pixotter's batch resize tool to normalize all images to the same dimensions before assembly. Pick your target size once, drop all frames, and download the batch -- all processed in your browser.
2. Sequential file naming
FFmpeg requires sequentially numbered files (frame_001.png, frame_002.png, ...). ImageMagick uses glob patterns but processes files in filesystem sort order.
A quick rename script:
# Rename all PNG files in current directory to sequential numbering
i=1; for f in *.png; do mv "$f" "$(printf 'frame_%03d.png' $i)"; i=$((i+1)); done
3. Choose the right source format
- PNG is ideal -- lossless, supports transparency, no compression artifacts.
- JPEG works but introduces artifacts that become visible in GIF's limited color space.
- WebP requires conversion first (FFmpeg handles this natively; ImageMagick needs
libwebp).
If your source images are JPEG, consider running them through Pixotter's format converter to get clean PNG frames before assembly.
4. Recommended frame rates by use case
| Use Case | Frame Rate | Delay (ms) | Notes |
|---|---|---|---|
| Screen recordings | 10-15 fps | 67-100 ms | UI motion does not need 30 fps |
| Product demos | 8-12 fps | 83-125 ms | Slower allows viewers to absorb detail |
| Memes / reaction GIFs | 12-15 fps | 67-83 ms | Match the original video's energy |
| Frame-by-frame animation | 8-12 fps | 83-125 ms | Hand-drawn work looks better at lower rates |
| Tutorial walkthroughs | 5-8 fps | 125-200 ms | Each step needs viewing time |
| Cinemagraphs | 15-24 fps | 42-67 ms | Smooth motion is the entire point |
Higher frame rates mean more frames, which means larger files. Start at 10 fps and increase only if the animation feels choppy.
Optimizing the Result
A raw GIF assembled from 100 frames at 1080p can easily hit 50-100 MB. That is unusable for most purposes. Optimization is not optional.
Palette optimization (FFmpeg)
FFmpeg's two-pass palette approach is the single most effective optimization. The palettegen filter builds a custom 256-color palette from your actual image data rather than using a generic color table.
Three stats modes to choose from:
| Mode | Best For | How It Works |
|---|---|---|
stats_mode=full |
Static backgrounds, slideshows | Weights all pixels equally across all frames |
stats_mode=diff |
Motion-heavy content | Prioritizes colors in regions that change between frames |
stats_mode=single |
Per-frame palette (largest files) | Generates a unique palette per frame |
For most use cases, diff produces the best balance of quality and file size.
Dithering options
Dithering simulates colors outside the 256-color palette by mixing nearby colors. FFmpeg supports several algorithms:
# Floyd-Steinberg (best general-purpose dithering)
-lavfi "paletteuse=dither=floyd_steinberg"
# Bayer (ordered dithering, produces a crosshatch pattern — retro aesthetic)
-lavfi "paletteuse=dither=bayer:bayer_scale=3"
# No dithering (sharp edges but visible banding)
-lavfi "paletteuse=dither=none"
Floyd-Steinberg is the right default. Use Bayer if you want a deliberate pixel-art look. Skip dithering only for graphics with flat colors (logos, diagrams, pixel art).
Frame delay and timing
GIF frame delays have a minimum practical value. Most browsers and image viewers clamp delays below 20 ms to 100 ms (10 fps). Setting -delay 1 in ImageMagick (10 ms per frame) will not give you 100 fps -- it will play at 10 fps in Chrome and at unpredictable speeds elsewhere.
Safe range: 20 ms (50 fps) to 200 ms (5 fps). Stay within this to get consistent playback across platforms.
Reducing file size
Ordered by effectiveness:
- Reduce dimensions. A 480px-wide GIF is usually sufficient. Going from 1080px to 480px cuts pixel count by ~80%.
- Reduce frame count. Drop every other frame and halve the delay to maintain perceived speed.
- Reduce colors. Drop from 256 to 128 or 64 colors. Noticeable on photographic content, barely visible on graphics.
- Optimize inter-frame encoding. Gifsicle 1.95 is the best post-processing optimizer:
# Install gifsicle
# macOS: brew install gifsicle
# Ubuntu/Debian: sudo apt install gifsicle
# Optimize with lossy compression (lower = more aggressive)
gifsicle -O3 --lossy=80 --colors 128 input.gif -o optimized.gif
- Compress the output. After creating your GIF, run it through Pixotter's GIF compressor for additional lossless and lossy optimization without leaving your browser.
If you have already tried all of the above and the file is still too large, the content is probably better suited to video. Convert the GIF to MP4 for 90%+ size reduction with better quality.
When GIF Is the Wrong Format
GIF is great for short, simple animations. It is not great for:
- Anything over 10 seconds -- file sizes explode. Use MP4 or WebM.
- Photographic content -- 256 colors cannot represent photographs well. Use video or APNG.
- Content that needs audio -- GIF has no audio track. Use video.
- Anything needing semi-transparency -- GIF supports binary transparency only (fully transparent or fully opaque). Use APNG or WebM with alpha.
If you are unsure whether GIF is the right format, our GIF format explainer covers the technical details and when to use alternatives.
Frequently Asked Questions
How many images can I use to create a GIF?
FFmpeg and ImageMagick handle thousands of images without issue -- the limit is available RAM. For FFmpeg, memory usage scales with frame dimensions, not frame count, because it processes frames sequentially. ImageMagick loads all frames into memory simultaneously, so very large batches (1,000+ full-resolution images) may need the -limit memory flag. GIMP and Photoshop become impractical above 50-100 frames. ezgif accepts up to 2,000 images but caps total upload size at 100 MB.
What frame rate should I use for my GIF?
10-15 fps is the sweet spot for most use cases. Screen recordings and product demos look fine at 10 fps. Memes and reaction GIFs feel natural at 12-15 fps. Only cinemagraphs and smooth-motion content benefit from going higher (15-24 fps). Every additional frame increases file size proportionally, so start low and increase only if the animation looks choppy.
Why does my GIF have color banding or look washed out?
GIF is limited to 256 colors per frame. If your source images have gradients, complex lighting, or photographic detail, the conversion to 256 colors creates visible banding. Fix this by using FFmpeg's two-pass palette generation with Floyd-Steinberg dithering. If banding persists, the content may be better suited to video format -- see our GIF to MP4 conversion guide.
Can I create a GIF with transparent background?
Yes. Use PNG source images with transparency and pass the transparency flag during encoding. In FFmpeg, this requires careful filter setup -- the palettegen filter needs reserve_transparent=1 to include a transparency entry in the palette. In ImageMagick, it works automatically if your source PNGs have an alpha channel. The output will have binary transparency only (each pixel is fully transparent or fully opaque -- no semi-transparency).
How do I control the speed of an existing GIF?
If you have already created your GIF and want to speed it up or slow it down, use Pixotter's GIF speed tool to adjust playback timing in your browser. For command-line control, Gifsicle can modify frame delays without re-encoding: gifsicle --delay 5 input.gif -o faster.gif sets each frame to 50 ms. You can also crop a GIF to trim unnecessary frames from the beginning or end.
My GIF file is too large. How do I reduce it?
Work through the optimization checklist in order: reduce dimensions first (480px wide covers most use cases), then reduce frame count (drop every other frame), then reduce colors (128 instead of 256), then apply Gifsicle optimization (gifsicle -O3 --lossy=80). If all that still leaves a file that is too large, run it through Pixotter's GIF compressor for further reduction. For files that need to be under a specific size limit, see our guides on compressing images to target sizes. If the GIF remains impractical, convert to MP4 -- video compression typically achieves 90-95% smaller files with better visual quality.
Wrapping Up
Creating a GIF from images comes down to three steps: prepare your frames (consistent dimensions, sequential naming), assemble with the right tool (FFmpeg for quality, ImageMagick for simplicity), and optimize the output (palette, dithering, compression).
Get your source images ready with Pixotter's resize and compress tools -- all processing happens in your browser, nothing gets uploaded. After assembly, run the final GIF through the GIF compressor to squeeze out extra bytes. And if your content includes format conversions as part of the workflow, check out the full set of image conversion tools.
Try it yourself
Resize to exact dimensions for any platform — free, instant, no signup. Your images never leave your browser.