PNG to GIF Converter
Turn PNG files into GIF. The list tells you how many colours the picture had, how many the GIF kept, and what happened to soft edges.
https://flxcode.com/png-to-gif/
or drop them here, or paste with Ctrl+V
HEIC, WebP, AVIF, PNG, JPG, GIF and BMP. Up to 50 files and 500 MB at a time. Nothing is uploaded.
Works offline: load this page, convert one file, turn off Wi-Fi, convert more. Location and camera data are removed from the converted files.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.
Problem or idea? Email us
Quick start
- Add one PNG for a still GIF, or tick "Join all pictures" and add several for an animation.
- Read the line under each file: colours in, colours kept, pixels that changed.
- Save the GIF or the zip. Change a setting and press "Convert again" to compare.
Offline use: convert one file, then turn off Wi-Fi.
What a GIF cannot hold
A GIF has one palette of at most 256 colours, and a pixel is either solid or fully see-through. A PNG can have millions of colours and 256 levels of see-through. So the conversion is a reduction, and the list prints the numbers for each file.
A picture with 256 colours or fewer, such as a logo or a screenshot of flat graphics, is written exactly (255 when it has see-through pixels, or when pictures are joined into an animation). A photo or a gradient is cut down to 256 colours, and dithering can hide the steps at the price of grain. A soft shadow does not survive: each of its pixels turns clear (alpha under 128) or solid.
Several PNGs can be joined into one animated GIF. The frames play in list order, all at the same time per frame, and pictures of a different size are fitted inside the first one. For video, the video to GIF page is the better fit.
What changes in the file
- Colours: exact up to 256 for one picture. 255 when it has see-through pixels, and 255 in a joined animation. Otherwise reduced to a 256-colour palette.
- Transparency: alpha under 128 becomes see-through, 128 and above becomes solid in its own colour. No in-between.
- Dither: off by default. On, it spreads the colour error over neighbouring pixels (Floyd-Steinberg).
- Animation: the time per frame is rounded to hundredths of a second and is at least 20 ms.
Worked example
Three small pictures made in code and written by the same function as the page. The counts are what the list prints for a file.
| Picture | Size | Colours in | Palette | Soft pixels changed | GIF size |
|---|---|---|---|---|---|
| Flat colours | 24 × 24 | 4 | 4, exact | 0 | 155 B |
| Flat colours and a soft shadow | 24 × 24 | 2 | 3, exact | 128 | 180 B |
| A smooth gradient | 32 × 32 | 1024 | 256, reduced | 0 | 1.7 KB |
Limits
- Up to 50 files and 500 MB at a time. A joined animation is limited by memory: about 400 MB of frames.
- GIF files are often bigger than the PNG for photos, because GIF compresses less well. The row shows both sizes.
- Other pictures (JPG, WebP, HEIC, AVIF) also work as input, but PNG is what this page is made for.
How it works and privacy
The browser opens the PNG and draws it on a canvas. The page counts the colours, builds the palette and writes the GIF with the same encoder as the GIF maker. Nothing is uploaded or stored. A finished batch counts one event, "png>gif", and never a file name or size (details).
Zip files are made with fflate. Licences: Open source used on this site.
FAQ
Why does my PNG look worse as a GIF?
GIF has at most 256 colours. A photo or a gradient has far more, so smooth areas turn into steps. Turn on dither to trade the steps for fine grain. The row tells you how many colours were cut.
What happens to a soft shadow or a faded edge?
GIF has no half-see-through pixels. Each one with alpha under 128 becomes clear, the others become solid in their own colour. The row counts both groups, so you can see how much changed.
Is a flat logo converted without loss?
If it has 256 colours or fewer, yes: the palette holds each colour exactly. With see-through pixels one slot goes to see-through, so the limit is 255 colours.
How do I make an animated GIF from PNG files?
Tick "Join all pictures into one animated GIF", add the frames in the order you want, set the time per frame and press convert. Frames of another size are fitted inside the first one.
Why is the GIF bigger than my PNG?
PNG compresses photos and gradients better than GIF does. GIF wins on small flat pictures only some of the time. Compare the sizes in the list before you save.
Can I get more than 256 colours in a GIF?
Not in one frame. An animation can use a different palette per frame, which the option "Own palette for each frame" does, at the cost of a bigger file.
More from FLXCode
- GIF MakerMake an animated GIF from pictures. Reorder frames, set delays, repeat and size. Runs in your browser, no upload.
- PNG to JPG ConverterConvert PNG images to smaller JPG files in your browser. Choose the quality. Nothing is uploaded.
- WebP to GIF ConverterTurn an animated WebP into a GIF in your browser. Frames, timing and repeat carry over. No upload.
- GIF CompressorMake a GIF smaller with fewer colors, dropped frames and a smaller size. Shows before and after. In your browser.