Skip to content
Limited timeStarter is now $9 a month instead of $20.See plans
charmotion

How to Convert a Video to GIF (MP4, MOV, WebM) Without Losing Quality

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: How to Convert a Video to GIF (MP4, MOV, WebM) Without Losing Quality, with Charmotion demo characters

To convert a video to GIF, trim it to a few seconds, lower the frame rate to about 10 to 15 fps, scale it to the width it will display at, and encode with a palette built from the clip. A free browser converter, ffmpeg (palettegen plus paletteuse), gifski or Photoshop all work for MP4, MOV and WebM.

Key takeaways

  • Quality comes from the palette: GIF frames hold at most 256 colors, so build the palette from your own clip instead of a generic one.
  • Size grows with width x height x frames; cut length, fps and width before you touch quality settings.
  • GIF timing is stored in hundredths of a second, so 10, 20, 25 or 50 fps are exact and 30 fps is rounded.
  • Transparency is 1-bit: soft edges from a transparent WebM become hard cutouts.
  • On a website, an autoplaying muted MP4 or WebM is far smaller than the same clip as a GIF.

How do I convert a video to GIF for free?

Disclosure: Charmotion is our product. We list it where it fits and say where other tools are better; every other fact links to its source.

The quickest route is our free Video to GIF converter. It runs entirely in your browser, so the video is never uploaded:

  1. Drop in an MP4, MOV or WebM file.
  2. Trim to the part you need. Shorter is better: every extra second adds frames.
  3. Choose the frame rate and output width. Around 10 to 15 fps and the width it will actually display at is a good start.
  4. Convert and download the GIF. If the source is a transparent WebM, the transparency is kept (as GIF's on/off transparency).

If the GIF is for a Slack emoji, the separate Slack GIF Emoji Maker also crops it square and keeps it under Slack's limits. And if you are starting from a still logo or character rather than a video, a GIF needs motion first: Charmotion animates one uploaded image and exports a 480 px GIF next to MP4 and transparent WebM, but for converting video you already have, the free tool above (or any method below) is all you need.

Other online converters such as ezgif do the same job on their servers. As of November 2026 ezgif's video to GIF page accepts files up to 200 MB, deletes uploads after one hour, and caps the clip length by frame rate (for example 30 seconds at 10 fps).

How do I convert MP4 to GIF in high quality?

A "high quality" GIF is mostly a matter of not wasting the 256 colors and not storing pixels nobody will see. In order of impact:

  1. Trim. Keep only the moment that matters, usually 2 to 6 seconds.
  2. Scale to display size. A 1920 px wide GIF shown at 480 px stores 16 times the pixels it needs. Use a sharp scaler such as Lanczos when you shrink.
  3. Lower the frame rate. 10 to 15 fps reads as smooth for most clips; screen recordings and slow motion often look fine at 10.
  4. Build a palette from the clip. A generic web palette wastes colors your video never uses. Tools that analyze the clip first (ffmpeg palettegen, gifski, Photoshop's adaptive options) look far better.
  5. Pick dithering deliberately. Dithering hides banding in gradients but adds noise, and noise makes files bigger. Try ordered (Bayer) dithering, which ffmpeg describes as deterministic, and no dithering for flat graphics and screen recordings.

A GIF still cannot match the source video: gradients, skin tones, smoke and dark scenes band or speckle. If those matter and the destination allows video, upload the MP4 instead.

How do I convert video to GIF with ffmpeg?

ffmpeg's two palette filters do the work. Per the FFmpeg documentation, palettegen generates "one palette for a whole video stream," and paletteuse uses "a palette to downsample an input video stream." This single command trims 4 seconds starting at 0:02, drops to 15 fps, scales to 480 px wide with Lanczos, builds a palette and applies it:

ffmpeg -ss 2 -t 4 -i input.mp4 \
  -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" \
  -loop 0 output.gif

What the options do, per the docs:

  • stats_mode=diff computes the palette only from the parts that change between frames, giving "more importance to the moving part of your input if the background is static." The default, full, uses whole frames.
  • dither=bayer selects ordered 8x8 Bayer dithering. bayer_scale runs from 0 to 5: lower values show more pattern and less banding. The default dither is sierra2_4a.
  • diff_mode=rectangle reprocesses only the changing rectangle, which the docs say gives "less moving noise and better GIF compression."
  • -loop 0 tells the GIF muxer to loop indefinitely (the default); -1 plays once.

The same thing as two passes, handy when you want to inspect or reuse palette.png:

ffmpeg -ss 2 -t 4 -i input.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,palettegen=stats_mode=diff" palette.png
ffmpeg -ss 2 -t 4 -i input.mp4 -i palette.png \
  -filter_complex "[0:v]fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" \
  -loop 0 output.gif

For a transparent WebM, force the VP9 decoder before -i (ffmpeg's default decoder drops the alpha) and reserve a palette entry for transparency. alpha_threshold=128 is the default cutoff between transparent and opaque:

ffmpeg -c:v libvpx-vp9 -i input.webm \
  -filter_complex "fps=15,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen=reserve_transparent=1[p];[b][p]paletteuse=alpha_threshold=128" \
  -loop 0 output.gif

Edges, halos and matte colors are explained in PNG to transparent animated GIF.

What other tools convert video to GIF: gifski, Photoshop, iPhone and Android?

gifski

gifski calls itself the "highest-quality GIF encoder." It uses pngquant for palettes and temporal dithering and can reach "thousands of colors per frame." It is free and open source, with a macOS app, a Windows installer and a command line for Linux, macOS and Windows (using it inside a closed-source product needs a commercial license). Its site shows gifski --fps 10 --width 320 -o anim.gif video.mp4, but notes you may need ffmpeg to export frames first, depending on the build:

ffmpeg -ss 2 -t 4 -i input.mp4 -vf "fps=15" frame%04d.png
gifski --fps 15 --width 480 -o output.gif frame*.png

Photoshop

Adobe's tutorial: choose File > Import > Video Frames to Layers, pick the clip and limit the import to a segment or every second frame if it is long ("Photoshop may not be able to fully import a video that is too long"). Open Window > Timeline, create a frame animation from the layers, set looping to Forever, then export with File > Export > Save for Web (Legacy), 256 colors, at the width you need.

iPhone

Apple's Shortcuts app includes a Make GIF action; Apple's own guide uses it to "build an animated GIF" from photos. 9to5Mac describes a ready-made Make GIF shortcut that accepts a video or Live Photo and saves the GIF to Photos; trim long videos first.

Android

There is no single built-in method across Android phones. Samsung's Gallery app can "turn photos or short video clips into animated GIFs," though menu names vary by model and software version. On other phones, the browser tool above works without installing anything.

Why are GIFs so big, and what are GIF's limits?

GIF is a 1980s image format stretched into animation, and its rules come from the GIF89a specification:

  • 256 colors per frame at most. The color table size is 2 raised to (field + 1), with a 3-bit field, so the ceiling is 2 to the power of 8, or 256. Every frame is reduced to that palette, which is why gradients band.
  • 1-bit transparency. A frame can mark one palette index as transparent. A pixel is either fully see-through or fully opaque; there is no partial alpha, so soft edges become jagged or haloed.
  • Timing in hundredths of a second. The Graphic Control Extension stores the delay as "the number of hundredths (1/100) of a second." 10, 20, 25 and 50 fps fit exactly (10, 5, 4 and 2 hundredths); 15 fps (6.67), 30 fps (3.33) and 60 fps (1.67) do not and have to be rounded, and ffmpeg notes the delay "can therefore not be smaller than one centisecond."
  • Weak compression. GIF compresses each frame losslessly with LZW and has no motion prediction like video codecs, so size rises with width x height x number of frames, and noisy footage compresses worst.

web.dev's example shows the gap: a 3.7 MB GIF became a 551 KB MP4 and a 341 KB WebM. That is why halving the width (a quarter of the pixels) or the frame rate saves far more than any quality slider.

What size should a GIF be for GIPHY, Slack and other sites?

Only some destinations publish limits. These are from each platform's own help pages, as of November 2026:

DestinationPublished limitPractical target
GIPHY GIF upload15 seconds and 100 MB; source video 720p maxGIPHY recommends 6 seconds or less, 8 MB or less, 480p, and fewer than 100 to 200 frames
GIPHY stickerGIF only, 100 MB and 15 seconds, transparent, set to loop forever6 seconds or less; see making GIPHY stickers
Slack custom emojiJPG, PNG or GIF; "Square images under 128KB" work best; GIFs up to 50 frames128 x 128 px; see Slack GIF emoji
Email signature, Discord, Product HuntVaries by client or platformSee email signatures, Discord emoji and stickers, Product Hunt

Converting a logo rather than footage? Logo to GIF covers palettes and backgrounds for flat brand art.

When should you not use a GIF?

Whenever the destination plays video. On your own website, replace the GIF with a muted, looping video: web.dev recommends a <video> element with autoplay, loop, muted and playsinline, which reproduces GIF behavior at a fraction of the size. Social networks and slide tools also accept MP4 directly.

<video autoplay loop muted playsinline width="480">
  <source src="clip.webm" type="video/webm">
  <source src="clip.mp4" type="video/mp4">
</video>

Keep GIF for places that only accept images: email, chat emoji and reactions, issue trackers, README files and some documentation tools. For motion that must react to users inside an app, a vector format such as Lottie or Rive is a better fit than either. GIF vs WebM vs MP4 vs Rive compares all of them.

Convert a video to a high-quality GIF

  1. Trim the clip. Keep only the 2 to 6 seconds you need; every extra second adds frames and file size.
  2. Set frame rate and width. Use about 10 to 15 fps and the width the GIF will display at, scaled with a sharp filter such as Lanczos.
  3. Build a palette from the clip. Use a converter that analyzes your video (ffmpeg palettegen, gifski, Photoshop or the free browser tool) instead of a fixed palette.
  4. Choose dithering. Use light or ordered dithering for footage with gradients, none for flat graphics and screen recordings.
  5. Check size against the destination. Compare the file with the platform limit (for example Slack emoji under 128 KB) and reduce width, fps or length if it is over.

Frequently asked questions

Why does my GIF look grainy or banded?

GIF frames hold at most 256 colors, so smooth gradients are either split into visible bands or broken up with dither noise. Build the palette from your clip, try Bayer dithering, or use video where the destination allows it.

How do I make a GIF smaller?

Cut the length, lower the frame rate to 10 to 15 fps and reduce the width; halving the width removes three quarters of the pixels. Then try fewer colors or no dithering. Quality sliders alone rarely save as much.

Can a GIF have a transparent background?

Yes, but only on/off transparency: one palette color is fully transparent. Convert from a transparent WebM or MOV and soft edges become hard cutouts, so the GIF looks best on the background color it was made for.

What frame rate should a GIF be?

Usually 10 to 15 fps. GIF stores delays in hundredths of a second, so rates that divide 100 evenly (10, 20, 25, 50 fps) are exact, while 30 fps has to be rounded.

Can I convert a GIF back to MP4?

Yes. web.dev shows an ffmpeg command for GIF to MP4 with libx264 and one for WebM with VP9. The video is usually much smaller, but it cannot restore colors the GIF already discarded.

Quick answers from this guide

Sources

Related guides