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 type | Typical colors | GIF result | Verdict |
|---|---|---|---|
| App icon, 512 x 512 | 12 to 30 | Indistinguishable; 24 KB PNG becomes about 9 KB GIF | Excellent |
| Line-art diagram | Under 16 | Pixel-identical edges, often smaller file | Excellent |
| Pixel art, 256 x 256 | 8 to 64 | Lossless in practice | Excellent |
| Cartoon illustration, 900 x 1200 | 100 to 250 | Very close match | Good |
| Sunset or sky photo, 1600 x 900 | Thousands | Visible banding in gradients | Poor |
| Portrait photograph | Millions | Skin tones shift, texture posterizes | Poor |
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)
- Drop your PNG onto the upload area, or click to pick a file. JPG, WebP, and BMP inputs work too.
- Run the conversion. The tool builds a 256-color palette from your image and re-encodes it as GIF, all locally in your browser.
- Study the preview, especially gradients and shadows, where quantization shows first.
- Note the size comparison next to the preview, then download if the result passes your inspection.
- 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.