Image · 55 tools · nothing uploads

PNG to GIF

Quantise a PNG down to a 256-colour GIF palette. A photograph loses its gradients; flat graphics and line art come through almost untouched.

Input

PNG to GIF clusters every colour in the source down to 256 at most, then snaps each pixel to the nearest survivor with no error diffusion. Photographs band. Flat artwork and line art often have fewer than 256 colours to start with and come through untouched. Clear pixels are written opaque, since no transparent index is set.

Questions

What happens to a photograph?

It loses its gradients. GIF stores at most 256 colors per frame, so the encoder quantizes the full 24-bit color down to that palette, and a smooth sky or skin tone comes out banded where the palette runs out of nearby shades.

What about flat graphics?

Those come through close to untouched, since a logo or line art with few distinct colors fits inside a 256-color palette with little visible change. This is the one image pair where the source content matters more than usual for how much is lost.

Which engine handles this?

gifenc quantizes the palette and writes the frame, reading pixels jSquash already decoded from the PNG. Both run in Node, on the command line, through MCP and in the browser, with no dithering applied, so banding shows as flat steps rather than a smoothed gradient.

What size should I expect?

Usually smaller for simple graphics, since a 256-color palette needs less data per pixel than full 24-bit color. A photograph can land at a similar size or larger once the palette forces extra edges into what was a smooth area.

What is the reverse page?

GIF to PNG runs the opposite direction, reading the first frame and writing it losslessly, though it cannot recover colors the palette already dropped.

Related Image tools