PNG to GIF converter
Convert PNG images to GIF format
This turns one PNG into one still GIF. The catch is colour: a GIF picture indexes into a palette, and the palette used here is the fixed 216-entry web-safe cube, with each channel snapped to 0, 51, 102, 153, 204 or 255. Every pixel is matched to its nearest cube entry by plain RGB distance, with no dithering to hide the jump. Flat artwork whose colours already sit on that grid converts perfectly; a photograph or a gradient will show visible bands. Nothing in this pair produces animation - a GIF made here holds a single frame.
Key facts about PNG to GIF converter
| Palette | Fixed 216-colour web-safe cube, six evenly spaced levels per channel. The colour table is not built from your image, so unusual brand colours get rounded to the nearest cube point. |
|---|---|
| Dithering | None. Each pixel picks its closest palette entry independently, which keeps edges crisp and makes gradients band. |
| Frames | Exactly one. The file carries no Netscape looping block and no graphic control extensions, so it is a still picture in a GIF wrapper. |
| Transparency | Not preserved. No palette index is reserved as transparent, and since only RGB is read, a transparent PNG area is written as black. |
| Compression | Standard GIF LZW over the palette indices, computed in the page, with the code table reset when it reaches 4096 entries. |
| Header | GIF89a with a 256-entry global colour table; the 40 entries past the cube are zeroed padding. |
| Size behaviour | Unpredictable in a way other targets are not - a flat logo can compress below its PNG, while a photo usually lands larger because LZW cannot handle noisy index runs. |
| Colour ceiling | 216 distinct colours maximum against PNG's 16.7 million, which is why the tool shows an amber palette warning before you convert. |
| Opens natively in | Everything - browsers, Windows Photos, macOS Preview, chat apps and email clients have read GIF for three decades. |
What happens to your file
The palette matching and the LZW compression are both plain JavaScript running on this page, not a service and not a WebAssembly download. Your PNG is decoded by the browser into a canvas, getImageData returns the pixel array, a nearest-colour search maps each pixel to one of the 216 entries, and the encoder emits the GIF header, the colour table and the compressed image blocks into a Blob. The picture is never serialised to a request body, and no part of the pipeline needs a connection.
About this tool
- 1
Select a PNG
Flat-colour artwork, pixel art, diagrams and icons are the inputs this pair handles well.
- 2
Read the palette notice
The amber banner above the drop area is the honest summary: 256 colours is the format's ceiling and this encoder uses 216 of them.
- 3
Resize if the GIF is for a chat or a forum
The presets down to 200 px help, because index data compresses better at small sizes.
- 4
Convert and inspect the flat areas
Skies, drop shadows and soft gradients are where the banding appears first. Download the .gif when it looks acceptable.
| Input and output | Takes .png only (image/png) and returns .gif with the image/gif type; any other extension is refused before decoding. |
|---|---|
| Conversion path | PNG to GIF runs in three steps: an <img> element hands the file to the browser's own PNG decoder; the pixels land on a 2D canvas in this tab; then getImageData feeds a palette mapper and an LZW encoder that live in the page. |
| Browser support | The PNG side decodes in every browser ever shipped, while writing the GIF needs nothing from the browser, the encoder shipping inside the page. |
| Controls for this pair | No quality slider, GIF not being a lossy target here, so the max-dimension presets from 3840 down to 200 px are the only way to hold the GIF down in size against the PNG. |
| Batch, caps and naming | Twenty PNG files per run at 500 MB each; one result downloads as a single GIF, several as converted-gif-files.zip, zipped by JSZip 3.10 in page memory. |
| Device ceiling | The canvas caps it: past roughly 16,384 px a side Chromium refuses the bitmap and iPhone Safari gives up sooner, so an oversized PNG fails before any GIF bytes exist. |
- Snap your artwork's colours to the web-safe values before converting and the output will match the source exactly, because nothing has to be rounded.
- A logo with a drop shadow is the worst case here: the shadow is both a gradient and, if it was transparent, a black smear.
- When you only need wide compatibility rather than the GIF format itself, PNG is already universal and keeps all its colours.
- Pixel art scaled up with the presets stays sharp in index space, so a 200 px sprite enlarged before conversion does not soften.
- Producing a still GIF for a legacy forum, wiki or bulletin-board template that only accepts .gif uploads.
- Making a small indexed asset for a retro-styled site or a game UI where the 216-colour look is the point.
- Getting a diagram into an old document system whose image importer predates PNG support.
Related tools
View allNeed the opposite? Try GIF to PNG
Works well with this4
Other GIF tools12
Updated