🎞️

PNG to GIF

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Images Editing Tools
🖼️

Drag & drop your image here
or click to choose a file

GIF has been around since 1987, and one fact defines everything about it: a GIF can hold at most 256 distinct colors, while a typical PNG photograph contains millions. Converting a PNG to GIF therefore always involves a color reduction step, and how well your image survives it depends almost entirely on what kind of image it is. A flat app icon with a dozen colors converts beautifully. A sunset photograph with smooth gradients comes out with visible banding. This tool performs the conversion in your browser, automatically reducing the palette with median-cut quantization, and it is worth understanding exactly what that process does before you judge the result.

The workflow is deliberately simple. Drop a PNG onto the upload area, let the tool quantize and encode it, review the preview for color shifts, and download the GIF. Processing happens entirely on your device with no upload step, so it is equally fine for a client logo or a screenshot of an internal system.

An honest expectation up front: if your PNG is a photograph, the GIF will lose color fidelity, and no setting changes that, because 256 colors is a hard ceiling baked into the format. If your PNG is flat graphic design, such as icons, diagrams, pixel art, or bold illustrations, the conversion is often visually indistinguishable and sometimes even smaller than the PNG. Choose GIF when a target platform or an old workflow requires it, not as a general-purpose PNG replacement.

What Is GIF and Why Only 256 Colors?

GIF was designed in 1987 for the slow networks of the era, and its authors solved the color problem with a palette: instead of storing full color per pixel, the file contains a table of up to 256 RGB colors, and each pixel is stored as a single byte indexing into that table. One byte per pixel instead of three is what made GIF efficient on 1987 hardware, and the LZW compression layered on top squeezed out further redundancy. The 256-color ceiling was a deliberate engineering trade-off, and it has never been lifted in the nearly four decades since.

The palette table is also why GIF is flexible in an unexpected way. The 256 colors are not fixed; they are chosen per image. The encoder looks at your actual pixels and picks the 256 colors that best represent them, which is why a cartoon with a limited color range can look perfect as a GIF while a photo with every hue of orange in a sunset cannot fit its colors into any 256-entry table. PNG, by contrast, stores true 24-bit color per pixel and compresses losslessly, with no palette ceiling at all.

How Median-Cut Quantization Works

This tool reduces colors using the median-cut algorithm, a classic method that is easy to describe. Imagine placing every one of your image's pixels as a point in a three-dimensional RGB color space. The algorithm starts with one box containing all those points, then repeatedly finds the box containing the most pixels, splits it down the middle of its longest color axis, and continues until there are exactly 256 boxes. The average color of each box becomes one palette entry, and every pixel is mapped to its nearest palette color.

The result is a palette that spends its entries where your image actually has color detail. A logo that is 90 percent navy and white gets its palette dominated by navy variants; a forest photo gets dozens of greens. Median cut is not the most modern quantizer available, but it is fast, predictable, and produces clean results on flat graphics. Where it visibly struggles is smooth photographic gradients: neighboring palette entries are spread across a wide color range, so a gradual sky transition jumps between discrete colors instead of sliding smoothly, which your eye reads as banding.

What Converts Well and What Does Not

Image typeTypical colorsGIF resultVerdict
App icon, 512 x 51212 to 30Indistinguishable; 24 KB PNG becomes about 9 KB GIFExcellent
Line-art diagramUnder 16Pixel-identical edges, often smaller fileExcellent
Pixel art, 256 x 2568 to 64Lossless in practiceExcellent
Cartoon illustration, 900 x 1200100 to 250Very close matchGood
Sunset or sky photo, 1600 x 900ThousandsVisible banding in gradientsPoor
Portrait photographMillionsSkin tones shift, texture posterizesPoor

The pattern is clear: the fewer and flatter your colors, the better GIF treats you. A useful pre-check is to zoom into the largest smooth gradient in your image. If you can see that it is already stepped or textured, quantization will not add much visible damage. If it is a perfectly smooth wash, expect bands.

How to Convert PNG to GIF (Step by Step)

  1. Drop your PNG onto the upload area, or click to pick a file. JPG, WebP, and BMP inputs work too.
  2. Run the conversion. The tool builds a 256-color palette from your image and re-encodes it as GIF, all locally in your browser.
  3. Study the preview, especially gradients and shadows, where quantization shows first.
  4. Note the size comparison next to the preview, then download if the result passes your inspection.
  5. If banding is unacceptable for a photographic image, convert to JPEG or WebP instead; both keep full 24-bit color.

When GIF Is Still the Right Choice

  • Platform requirements: some older forums, ticket systems, email signatures, and internal tools accept GIF and little else.
  • Simple graphics where it wins anyway: icons, charts, and pixel art often come out smaller as GIF than as PNG, because one byte per pixel beats lossless compression on limited palettes.
  • Downstream animation: if the image is headed into a GIF animation pipeline, starting from a GIF frame keeps the palette consistent.
  • Extreme compatibility: GIF renders on essentially every device and browser ever made, including ancient kiosks and legacy terminals.

For everything else, PNG or WebP is the better technical choice, with full color and usually competitive sizes. GIF earns its place through compatibility and palette efficiency on flat art, not through image quality.

Tips and Best Practices

  • Test with your most colorful image first. If it survives quantization, everything else in the batch will look better, not worse.
  • Flatten shadows before converting. Soft drop shadows span many nearly identical grays and eat palette entries; a harder shadow converts cleaner.
  • Avoid converting photographs to GIF for web use. A quality-80 JPEG or WebP will be smaller and dramatically more faithful.
  • Remember that this output is a static image. Animated GIF construction is a separate workflow involving multiple frames and timing data.
  • Keep the PNG master. If a client later wants the image with full color, re-converting from the GIF will not restore discarded shades, but the PNG still has them.

Frequently Asked Questions

Why does my image look different after converting to GIF?
GIF supports a maximum of 256 distinct colors, while your PNG may contain millions. During conversion, a median-cut algorithm selects the 256 colors that best represent the image and maps every pixel to the nearest palette entry. Flat graphics with few colors barely change; photographs with smooth gradients show banding and shifted tones. The difference is inherent to the format, not a tool setting, so no conversion software can preserve full 24-bit color in a GIF.
How many colors can a GIF have?
Exactly 256 at most. GIF stores one palette table of up to 256 RGB entries, and each pixel is a single-byte index into that table. The palette is chosen per image rather than fixed, which is why simple graphics look perfect. For pixels beyond the palette, encoders approximate with the nearest available color. If your PNG uses more than 256 colors, which nearly all photos and antialiased graphics do, some color information is necessarily discarded during conversion.
Is GIF smaller than PNG?
It depends entirely on the image. Flat graphics with limited palettes, such as icons, diagrams, and pixel art, often compress smaller as GIF because one byte per pixel plus LZW beats PNG's lossless pipeline on simple content; a 24 KB icon can drop to 9 KB. Photographs are a different story: after being forced into 256 colors, a photo-sized GIF frequently ends up similar in size to or larger than a well-compressed PNG, with far worse quality. GIF wins on simple art, loses on photos.
Does converting PNG to GIF support transparency?
Partially. GIF offers only binary transparency, meaning each palette entry is either fully opaque or fully transparent, with no partial levels. Antialiased edges that blend into the background will look jagged in transparent areas, because the intermediate blend pixels must either become solid or vanish. Fully transparent regions convert cleanly to fully transparent GIF regions. For smooth-edged cutouts and overlays, PNG with its full 8-bit alpha channel remains the correct format.
Why do gradients look banded in my GIF?
A smooth gradient passes through far more than 256 distinct colors, so the converter must map it onto discrete palette steps. Where PNG renders a continuous slide from dark blue to light, the GIF jumps between the handful of blue shades its palette contains, producing visible bands. Median-cut quantization spreads palette entries across the whole color range, which helps overall fidelity but limits how finely any one gradient can be represented. For gradient-heavy images, JPEG or WebP preserves smooth transitions far better.
Can I convert a JPG or WebP image to GIF with this tool?
Yes, the tool accepts PNG, JPG, WebP, BMP, and GIF as input, so you can convert from any of those formats to GIF output. The same 256-color quantization applies regardless of source format. Photos from any lossy source face the same palette ceiling and gradient banding. Animated source files contribute only their first frame, and the output GIF is a static image. For flat graphics and icons, converting from JPG or WebP to GIF works just as well as starting from PNG.

Related Tools