PNG vs GIF

PNG for still images, GIF only when it has to move.

Choose PNG when

Every still image, without exception. PNG has millions of colours to GIF’s 256, smooth transparency instead of a single hard-edged transparent colour, and smaller files.

Choose GIF when

Short looping animation where the audience or the platform will not take a video. That is the only thing GIF still does that PNG does not.

The thing that catches people out

GIF’s 256-colour limit is what makes a photograph look banded and speckled in one. That is not a compression setting; it is the format.

Switching from PNG to GIF

What is lost

GIF has no alpha channel. A transparent PNG comes out with those areas filled in — white unless something else is set — and no setting in GIF brings the transparency back.

GIF stores at most 256 colours per frame. A photograph converted into one is reduced to a palette, which is what makes the sky look stepped rather than smooth — it is the format, not a quality setting.

PNG carries up to 16 bits per channel and GIF stores 8. The extra precision is what survives heavy correction without banding, so the conversion is best made after the editing rather than before it.

What survives

Nothing is discarded. PNG and GIF both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Opening the result

Adobe Photoshop and GIMP read both PNG and GIF, so there is a way to check the result against the original without a second tool.

What each format is for

PNG is PNG Development Group's format, published in 1996. It records 16 bits per channel.

GIF comes from CompuServe and dates from 1987, specified as GIF89a. GIMP, Adobe Photoshop and ImageMagick all read it.

Switching from GIF to PNG

What is lost

PNG holds a single still image. An animated GIF keeps its first frame and loses the rest, so a conversion is a way to take a still out of one, not a way to move it.

What survives

Nothing is discarded. GIF and PNG both store their content losslessly, so the conversion is a change of packaging rather than a change of quality, and it can be repeated without accumulating damage.

Transparency survives. Both GIF and PNG store an alpha channel, so a cut-out stays cut out and nothing is filled in behind it.

Opening the result

GIF dates from 1987 and is largely superseded. PNG is what current software writes, so the conversion is as much about staying readable as about the file itself.

GIMP and Adobe Photoshop read both GIF and PNG, so there is a way to check the result against the original without a second tool.

What each format is for

GIF is CompuServe's format, published in 1987. It records 8 bits per channel.

PNG comes from PNG Development Group and dates from 1996, specified as ISO/IEC 15948. Adobe Photoshop, GIMP and Paint.NET all read it.

What PNG to GIF actually does

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as PNG.

PNG139 KB

A generated landscape with a low sun and three ridges, used to show what JPEG does to continuous tone. Shown as GIF.

GIF36 KB3.8× smaller

A photographic scene — smooth gradients, soft edges, grain. This is the case GIF is designed for or against, and the figures show which. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as PNG.

PNG7 KB

A generated badge: a circular gradient on a transparent background with a white bar across it, used to show what each format does with transparency and with hundreds of shades. Shown as GIF.

GIF8 KB8% larger

A transparent background and a gradient across the shape. GIF either keeps both, keeps one, or fills the transparency with a solid colour — which is the difference that catches people out. Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.
A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as PNG.

PNG3 KB

A generated application window with a sidebar, a table and a bar chart, used to show what JPEG does to flat colour and hard edges. Shown as GIF.

GIF6 KB2.4× larger

Flat colour and hard edges, as in an interface, a chart or a logo. Very different behaviour from the photograph above, and the reason the answer is "it depends what is in the file". Both images are drawn in code and encoded by the same converter that runs on this page, so the sizes are this site's own output.

Side by side

PNG and GIF compared row by row: what each stores, and what it costs.
PNGGIF
Full namePortable Network GraphicsGraphics Interchange Format
Extension.png.gif
Media typeimage/pngimage/gif
CompressionLossless — nothing is discardedLossless — nothing is discarded
This site can write itYesYes

PNG exists because GIF was encumbered

In 1994 the patent holder on GIF’s compression began asking for licence fees from software that wrote the format. Within months a group of developers had specified a replacement, and PNG was published in 1996: better compression, millions of colours instead of 256, real transparency, and free of any patent.

It succeeded almost completely. Everything GIF was used for in 1995 — logos, buttons, diagrams, interface graphics — became PNG, and the only thing left behind was the one feature PNG deliberately omitted.

The one thing GIF still does

Animation. A GIF holds a sequence of frames with timing, plays automatically, loops forever and needs no player, no controls and no permission — which is why it survived a format war it otherwise lost comprehensively.

PNG holds one frame. APNG, the animated extension, exists and is supported by every current browser, and it is still not what anybody means by "a gif". The word has stopped being a format and become a genre: short, silent, looping, posted. Platforms that accept "GIFs" now overwhelmingly convert them to video behind the scenes and keep the name.

Two hundred and fifty-six colours

A GIF picks a palette of at most 256 colours for the whole image, and every pixel must be one of them. For a logo with four flat colours that is plenty. For a photograph it is nowhere near enough — the sky bands into visible stripes, skin tones go blotchy, and gradients break into steps.

PNG carries millions of colours and does not choose. That difference is why a photograph should never be a GIF, and why old web pages full of GIF photographs look the way they do. The reduction is also permanent: converting that GIF to PNG preserves what is there and cannot restore the colours discarded when the palette was chosen.

Transparency is the sharpest difference

GIF transparency is one bit. A pixel is either completely see-through or completely opaque, with nothing in between, which is why cut-out GIFs have stair-stepped edges and a faint fringe of whatever colour they were designed against.

PNG has a full alpha channel with 256 levels, so an edge can fade properly and a logo can sit on any background. On a page with a coloured or patterned background, this is immediately visible, and it is the reason interface graphics moved to PNG the moment browsers supported it.

Size, in both directions

For a still image with few colours, GIF is occasionally smaller — a two-colour icon of a few hundred bytes is about as compact as it can be in either format. Beyond that, PNG wins: its compression is better, and it is not paying for a palette table.

For animation the comparison is brutal. GIF stores frames with only crude sharing between them, so a three-second clip routinely runs to several megabytes where the same clip as MP4 is a couple of hundred kilobytes and looks better. Any moving image that is genuinely video should be video; GIF’s file size is the reason platforms quietly convert it.

What to do with a GIF you have

If it is still: convert it to PNG. Smaller, no palette limit, proper transparency, and nothing is lost because the GIF had already discarded everything it was going to.

If it moves and needs to keep moving: convert it to MP4 or WebM. Every frame survives, it plays everywhere, and it is a fraction of the size. If it moves and the motion does not matter — a diagram that happens to have been saved as an animation — take the first frame as a PNG.

The only reason to keep a GIF as a GIF is a destination that will accept nothing else, which in 2026 is a short list: a few forum and email contexts, and some older signage or embedded displays.

For anything new, choose neither

A still graphic on a website should be WebP, with PNG as the fallback. WebP does everything PNG does at a quarter to a half fewer bytes, and it also handles animation, which makes the whole comparison on this page a historical one on the modern web.

A moving image should be a video — MP4 for compatibility, WebM where the site controls the player. The only situation that genuinely calls for a GIF today is one where somebody else’s system asks for it by name.

PNG or GIF: common questions

Is PNG better than GIF?

On every axis except animation: more colours, better compression, and proper transparency instead of GIF’s hard one-bit edges. PNG was created in 1996 specifically to replace GIF, and it did — apart from the moving image.

Can a PNG be animated?

APNG exists and every current browser supports it, but it never displaced GIF culturally and platforms do not expect it. For a moving image the practical answer today is video — MP4 or WebM — which is smaller and looks better than either.

Why does my photograph look banded as a GIF?

GIF allows at most 256 colours in the whole image, so a photograph’s gradients break into visible steps. The reduction happens when the file is made and is permanent — converting to PNG keeps what is left but cannot bring the colours back.

Why do my transparent GIFs have jagged edges?

GIF transparency is one bit: a pixel is fully transparent or fully opaque, with nothing in between. PNG has 256 levels of transparency, so edges can fade smoothly and a graphic can sit on any background colour.

Should I convert my GIFs to PNG?

Still ones, yes — smaller file, no palette limit, better transparency, and nothing is lost. Animated ones should become MP4 or WebM instead, where every frame survives at a fraction of the size.

Why is my animated GIF so large?

GIF stores each frame with only crude sharing between them, where video codecs describe what changed. A three-second clip that is several megabytes as a GIF is typically a couple of hundred kilobytes as an MP4, and looks better.

Decided? Convert it here

Where these figures come from

The claims this page makes about PNG and GIF are checkable, and these are the documents that settle them.