A PNG can hold millions of colors and a soft, feathered transparency. A GIF is an older format that stores at most 256 colors per frame and treats transparency as a simple on-or-off mask. Converting PNG to GIF means squeezing the picture down into that smaller palette, which works beautifully for some images and visibly damages others.
People usually want a GIF for reach: it plays and displays in places that predate newer formats, and it is the format most tools expect for a tiny looping animation. This guide is about the single-image case, what the palette limit really costs, how the conversion actually works step by step inside the encoder, and how to tell before you convert whether your PNG will survive the trip cleanly.
What the 256-color limit does
When a PNG is converted to GIF, the tool builds a palette of up to 256 colors that best represent the image, then maps every pixel to the nearest one. For a logo, an icon, a diagram, or a screenshot of flat interface elements, 256 colors is more than enough and the result is identical to the eye. For a photograph or a smooth gradient, it is nowhere near enough, and you get banding: the gradual color shift breaks into visible stripes.
Transparency changes too. PNG can make a pixel partly see-through, which is how soft shadows and anti-aliased edges blend into any background. GIF transparency is binary, so a pixel is either fully visible or fully invisible. Semi-transparent edges get a hard fringe, often against whatever background color the tool assumes.
If your PNG has soft transparent edges or a drop shadow, expect a jagged outline in the GIF. For those images, keeping the PNG or using WebP preserves the smooth blend.
PNG and GIF: two different color models
The whole difficulty of this conversion comes from two formats that store color in fundamentally different ways. PNG, the Portable Network Graphics format, was created in the mid-1990s explicitly as a patent-free, more capable replacement for GIF, and it is now maintained as a W3C Recommendation with a matching IETF specification, RFC 2083.[1] Its most common form is truecolor: every pixel carries its own red, green, and blue value with eight bits each, giving roughly 16.7 million possible colors, and an optional eighth-bit alpha channel gives each pixel its own level of transparency.[2] PNG compresses this with DEFLATE, a lossless algorithm, so it never discards a single color value.
GIF, the Graphics Interchange Format, works on the opposite principle. It is an indexed-color format: rather than storing a full color for every pixel, it keeps a small palette of up to 256 colors and stores, for each pixel, only a single-byte index pointing into that palette. GIF was created by CompuServe in 1987 and fixed in the GIF89a specification that still governs it today, a design shaped by the limited displays and slow modems of the era.[4] The 256-color ceiling is not a setting you can raise; it is exactly the number of distinct values a single byte can address, so it is baked into the format itself.[3]
Converting therefore means moving from a model that can describe any color per pixel to one that must first choose 256 colors and then approximate everything else with them. When your PNG already uses few colors, nothing is lost and the two files look identical. When it holds a photograph or a gradient, the approximation is unavoidable, and the rest of this guide is about managing it well.
How the quantization works under the hood
The conversion runs in three clear stages, and understanding them explains exactly where quality is kept and where it is spent. First the tool decodes the PNG, reversing its DEFLATE compression to rebuild the full grid of truecolor pixels in memory, complete with any alpha transparency.
Then comes the step unique to GIF, color quantization. Because each frame can hold only 256 colors, the encoder must analyze the actual pixels and select the 256 that best represent the whole image, building an optimized adaptive palette rather than a fixed generic one. A well-chosen adaptive palette is the single biggest factor in how good the result looks, because it spends those 256 slots where the image actually needs them. Once the palette exists, every pixel is mapped to its nearest palette entry, and this mapping is where color is genuinely lost: a shade that falls between two palette colors is rounded to whichever is closest.
Finally the indexed pixels are compressed with LZW (Lempel-Ziv-Welch), a lossless algorithm, and written into the GIF alongside the palette. Because LZW is lossless it never degrades the image further; all of the quality change happened in the quantization and mapping step, not in the compression. LZW works best on long runs of identical adjacent pixels, which is why flat graphics with large solid areas compress dramatically better than busy or noisy ones.
A subtle but important detail is that a PNG can arrive already carrying more than 256 colors even when it looks simple, because anti-aliasing quietly introduces dozens of intermediate shades along every curved or diagonal edge. Those blended edge pixels are the ones most likely to be reassigned during quantization, which is why a logo that appears to use only a handful of colors can still show faint roughness along its outlines after conversion. Knowing this, you can judge a PNG not just by its obvious color count but by how much soft edge work it contains, since that hidden variety is often what decides whether the GIF looks perfectly clean or subtly degraded.
Dithering and the size trade-off
When the palette cannot represent a color exactly, the encoder has two ways to handle it, and they trade quality against size in opposite directions. The first is to simply map each pixel to the nearest palette color. This produces large flat runs of identical color that LZW compresses beautifully, so the file stays small, but smooth gradients break into visible bands.
The second is dithering, where the encoder scatters pixels of two nearby palette colors in a fine pattern so that, from a normal viewing distance, your eye blends them into the missing shade. Dithering hides banding remarkably well on photographic content, but it destroys the long runs of identical color that LZW relies on, so a dithered GIF can be noticeably larger than the same image without it. For a flat graphic, leave dithering off and enjoy a tiny, crisp file; for a photograph you have decided must become a GIF, turn it on and accept the extra size in exchange for smoother-looking color. Crucially, dithering only disguises the 256-color limit, it never removes it, so it trades visible banding for a fine grain rather than restoring the lost shades.
Transparency: soft edges meet a hard mask
Transparency deserves its own attention because it is where PNG-to-GIF surprises people most. PNG's alpha channel gives every pixel a full 256 levels of opacity, which is how a logo can fade smoothly into any background and how anti-aliased text keeps clean edges on white, black, or a photo alike. GIF has nothing like this. Its transparency is a single flag on one palette entry: a pixel is either fully opaque or fully invisible, with no in-between.
The practical result is that any soft, feathered, or semi-transparent edge in your PNG has to be forced to a hard yes-or-no decision when it becomes a GIF. Pixels that were partly transparent get either flattened onto an assumed background color or snapped to fully transparent, which produces a jagged fringe or a halo of the wrong color around the subject. For a shape with crisp, fully-opaque edges this is invisible; for a drop shadow, a glow, or type anti-aliased against a color you did not expect, it can look distinctly rough. If a soft transparent edge matters, keeping the PNG or converting to WebP preserves the smooth blend that GIF simply cannot represent.
Convert PNG to GIF, step by step
Open the converter and add your PNG
Open the FileFormer image converter and drop your PNG in. The conversion runs on your device, so nothing is uploaded.
Select GIF as the target
Choose GIF from the output list. The tool will reduce the image to a 256-color palette as part of the export.
Preview and check for banding
Look closely at any gradients, skies, or skin tones. If you see stepped color, this image is a poor fit for GIF and you may want a different target format.
Convert and download
If the preview looks clean, export the GIF and download it. Flat graphics will look identical to the PNG at a smaller size.
Which PNGs convert cleanly
The deciding factor is how many distinct colors your image actually uses, not how big it is. The table sorts common PNG types by how well they survive the palette reduction.
| PNG content | Converts to GIF |
|---|---|
| Logo, icon, flat illustration | Cleanly, no visible loss |
| Diagram or chart with solid fills | Cleanly |
| Screenshot of a simple interface | Usually fine |
| Photograph | Poorly, expect banding |
| Image with soft transparent edges | Hard fringe appears |
A quick way to predict the outcome without converting is to think about the histogram of your image. If the colors cluster into a few dozen distinct values, as they do in interface graphics and vector-style art exported to PNG, the palette has room to spare and the GIF is effectively free of loss. If the colors spread continuously across thousands of subtle shades, as they do in any photograph, no palette of 256 can cover them and some compromise is guaranteed. The size of the file barely matters; a huge flat poster converts cleanly while a small photo thumbnail bands badly, because it is the variety of colors, not the pixel count, that the palette limit acts on.
If the same PNG needs to work as both a crisp graphic and a smooth photo, keep it as a PNG for anything detailed and export a GIF only for the specific low-color pieces that a legacy destination demands.
When GIF is the wrong target
If your goal is a still image that simply needs to be small and modern, GIF is rarely the best answer. GIF's indexed color and older LZW compression were designed for simple graphics, not detailed pictures, so for a rich image almost any modern still format beats it on both quality and size. For a photographic PNG, WebP keeps full color and soft transparency while being smaller than a GIF would be. If you only need a broadly compatible photo, converting to JPG is a better fit than forcing it through a 256-color palette, since JPEG was built for exactly that kind of continuous-tone content.
There is one more case worth naming. If you are reaching for GIF because you want animation, remember that WebP and short muted video loops now do the same job with full color and far smaller files, and most social platforms silently convert uploaded GIFs to video for that reason. GIF's genuine remaining strength is universal compatibility: it displays in email clients, wikis, forums, and legacy software that may refuse newer formats. Choose GIF specifically when the destination expects a GIF, when the palette limit costs you nothing because the image is already flat and low-color, or when you are building a short looping animation and want the one format that plays absolutely everywhere without a video player. For a single detailed image, the source PNG is usually the file worth keeping.
Convert your PNG to GIF now
Preview the palette result and export, all in your browser with nothing uploaded.
Key takeaways
- GIF caps the image at 256 colors, so photos and gradients band.
- GIF transparency is on or off, which hardens soft PNG edges.
- Flat graphics and logos convert with no visible loss.
- Dithering hides banding by trading it for grain, but cannot raise the color limit.
- For detailed images, WebP or the original PNG is usually a better choice.