Image to GIF
Published Updated
Choose your output scale, then convert your image into a downloadable GIF file — free, private, and processed entirely in your browser.
Up to 256 colors, one frame, no dithering
This tool writes a single-frame GIF from a PNG, JPG or WebP. The limits come from the format: a GIF frame uses one palette of at most 256 colors and one bit of transparency (GIF89a specification). The encoder here picks that palette by median-cut from up to 20,000 sampled pixels, then maps every pixel to its nearest palette color without dithering.
That is the right trade for logos, icons, screenshots and pixel art, where the image already has few colors. It is the wrong one for photographs: unless a form insists on GIF, keep the JPG.
What to expect by image type
| Source image | Result as GIF |
|---|---|
| Logo or icon with flat colors | Usually near-identical. Edges that were anti-aliased become hard. |
| Screenshot of an app or page | Text stays readable. Subtle gradients and shadows may band. |
| Photograph | Visible banding in skies and skin. File is often larger than the JPG. |
| PNG with soft transparency | Pixels at 50% alpha or more turn solid and the rest vanish. |
| JPG | No transparency to keep. Compression noise from the JPG is carried into the palette. |
Making the GIF
Step 1
Add a PNG, JPG or WebP
One image per run. The preview shows its original pixel size so you can judge the scale you need.
Step 2
Pick a scale
Choose 100%, 75%, 50% or 25% of the original width and height. Dimensions are rounded to whole pixels.
Step 3
Convert and download
The GIF is built in your browser. Compare the new file size with the original on the result card before saving.
Scaling before you convert
The scale option resizes the image on a canvas before the palette is built, so a smaller scale also means fewer pixels to index. Use it when an upload form caps pixel dimensions or when the GIF will sit in a small slot such as a forum avatar or an email signature.
If you need motion instead of a still, the GIF Maker turns two or more images into an animated GIF with a frame delay you choose.
How a pixel becomes a palette entry
Four steps run on the canvas data. First the image is drawn to a canvas at the chosen scale and read back as RGBA pixels. Second, every pixel with alpha below 128 is set aside as transparent. Third, up to 20,000 of the remaining pixels are sampled at an even stride and split by median cut into at most 255 or 256 colors (one slot is kept for the transparent color when it is needed). Fourth, each pixel is mapped to its nearest palette entry through a lookup table built on 5 bits per channel, and the indices are packed with GIF's variable-width LZW coding.
The 5-bit lookup means two colors that differ only in the lowest three bits of a channel get the same palette entry. The Library of Congress describes the format as palette-based color of 256 or fewer shades with LZW compression (Library of Congress, GIF 89a), and the specification stores transparency as a flag plus one color index (GIF89a specification), which is why there is no partial alpha.
Worked example: four generated 1200 x 800 images
The images were generated by a script, so they are synthetic: a flat logo of five colors, a screenshot-like page of small text, a photo-like gradient with grain, and a red disc with a soft blurred shadow. The site's own encoder (lib/gifEncoder.ts) was run on each in Node 22 at 100 percent scale, and the GIFs were then decoded with Pillow 11.3.0 to count colors. Scaling happens in the browser canvas, so it was not part of this run.
| Test image | PNG size | GIF size | Colors in the GIF |
|---|---|---|---|
| Flat logo, 5 colors | 7,827 B | 6,767 B | 5 |
| Screenshot-like text | 141,587 B | 102,438 B | 51 |
| Photo-like gradient and grain | 1,812,977 B (JPG at quality 85: 111,619 B) | 530,520 B | 256 |
| Disc with soft shadow (RGBA) | 47,538 B | 5,024 B | 10, plus transparent |
The photo-like image shows the cost. The GIF is smaller than the PNG, but 4.8 times larger than the JPG, and the decoded GIF differed from the PNG by 4.05 levels per channel on average (largest difference 29). One synthetic photo says nothing about real ones, but it fits the advice to keep photographs as JPG.
The shadow image shows the transparency rule. It has 181,314 partly transparent pixels and 769,723 pixels with alpha below 128. The decoded GIF has exactly 769,723 transparent pixels, so the soft edge became a hard one and the shadow's lighter half disappeared, as it had to.
Edge cases and limits
- One frame only. The output has no animation: the delay field is 0 and no looping block is written.
- The scale option takes the original width and height times 100, 75, 50 or 25 percent, rounded to whole pixels and never below 1 pixel. A 1200 x 800 image gives 900 x 600, 600 x 400 or 300 x 200.
- Many colors close together share palette entries. The palette is built from a sample, so a few rare colors, such as a thin colored line, may be replaced by a nearby color.
- A fully opaque image gets no transparent slot, so it can use all 256 entries.
Image to GIF in three browsers: what changes the file
We ran the converter component from this page in Google Chrome 157, Firefox 155 and Playwright's WebKit build (not the Safari app) on generated 1200 x 800 images: a four-colour logo as PNG and as lossless WebP, a photo-like gradient with grain as PNG, as JPEG (quality 85) and as lossy WebP (quality 80), and a red disc with a soft shadow on a transparent background. Each GIF was decoded again in the same browser and compared with the pixels the tool had read from its canvas.
| Input and scale | Chrome 157 | Firefox 155 | The WebKit build |
|---|---|---|---|
| Logo, PNG, 100% | 7,877 B | 7,877 B | 7,877 B |
| Logo, lossless WebP, 100% | 7,877 B | 7,877 B | 7,877 B |
| Photo-like, PNG, 100% | 571,897 B | 571,897 B | 571,897 B |
| Photo-like, PNG, 75% | 245,800 B | 250,920 B | 246,054 B |
| Photo-like, PNG, 50% | 101,705 B | 100,603 B | 101,190 B |
| Photo-like, PNG, 25% | 30,262 B | 30,192 B | 30,371 B |
| Photo-like, JPEG, 100% | 327,045 B | 327,466 B | 330,086 B |
| Photo-like, lossy WebP, 100% | 319,016 B | 320,648 B | 320,648 B |
| Soft shadow, PNG, 100% | 8,292 B | 7,494 B | 8,310 B |
The encoder is the same JavaScript in every browser; what differs is the picture each browser hands it. A PNG at 100% decoded to the same pixels in all three, so the GIF was identical to the byte, and the lossless WebP of the logo gave the very same GIF as its PNG. Scaling uses each browser's own canvas resampling, JPEG and lossy WebP go through each browser's own decoder (Firefox 155 and the WebKit build decoded the WebP identically), and the canvas returned slightly different colour values for the partly transparent shadow pixels in each engine, so those rows differ a little.
The transparency rule held everywhere: at 100% the shadow GIF had 757,063 transparent pixels in every engine, exactly the number of pixels with alpha below 128 in the PNG.
Colour error, conversion time and the size limit
| Input at 100% unless noted | Colours in the GIF | Mean channel error | Largest error |
|---|---|---|---|
| Logo, PNG or lossless WebP | 4 | 0 | 0 |
| Photo-like, PNG | 256 | 4.95 | 32 |
| Photo-like, PNG, 25% | 256 | 4.14 to 4.15 | 19 to 22 |
| Photo-like, JPEG | 256 | 4.45 to 4.51 | 27 |
| Soft shadow, PNG | 33, 21 and 34 | 0.06 to 0.07 | 11 to 12 |
| 4000 x 3000 photo-like JPEG | 256 | 5.15 to 5.17 | 41 to 44 |
Error is the absolute difference per colour channel, on the 0 to 255 scale, between the decoded GIF and the pixels the tool encoded, over the pixels that stay visible; a range spans the three engines, and the shadow's colour counts are Chrome 157, Firefox 155 and the WebKit build in that order.
From pressing Convert to GIF to the download link, the 1200 x 800 photo-like PNG took a median of 137 ms in Chrome 157, 178 ms in Firefox 155 and 104 ms in the WebKit build (5 runs each). The 4000 x 3000 JPEG, 12 million pixels, took 546, 598 and 376 ms (Convert pressed 5 times in one copy of the tool).
Images over 10,000 pixels on either side are refused as soon as you choose them, with the size in the message, for example "This image is 70,000 × 8 pixels. The limit is 10,000 pixels on each side." All three engines showed that message for test PNGs of 10,001 x 10, 40,000 x 16 and 70,000 x 8 pixels. GIF could not hold the widest of them anyway: the GIF89a specification gives the width and the height two bytes each, so 65,535 pixels is the most a GIF can record.
Image to GIF, answered
What happens to the transparent parts of my PNG?
GIF can only mark a pixel fully transparent or fully opaque. This tool treats anything with alpha below 128 (about 50%) as transparent and everything else as opaque. Soft shadows and anti-aliased edges therefore turn hard.
Will the GIF be animated?
No. The output has one frame. To turn several images into an animation, use the GIF Maker.
Why does my photo look blotchy as a GIF?
A GIF frame holds at most 256 colors, and this encoder does not dither. Smooth gradients such as skies get visible bands. Flat artwork, icons and screenshots convert with little change.
Is a GIF smaller than the JPG or PNG I started with?
Against a JPG, rarely: a photo saved as GIF is usually several times bigger and shows banding. Against a PNG it is often smaller, because 256 colors take less room than millions. For flat graphics with few colors, GIF and PNG are close.
Which scale should I choose?
Stay at 100% unless the destination has a size limit. A 1200 × 800 image gives 900 × 600 at 75%, 600 × 400 at 50% and 300 × 200 at 25%.
Why did the soft shadow disappear from my transparent PNG?
Pixels with alpha below 128 become fully transparent and the rest fully opaque. In our test a disc with a blurred shadow lost its lighter shadow pixels, and the GIF had exactly as many transparent pixels as the PNG had pixels below 128.
How many colors will my GIF really have?
Only as many as the picture needs, up to 256. Our five-color logo came out with 5 and the screenshot-like text with 51, while the photo-like gradient used all 256.
Can I make a GIF with a transparent background from a JPG?
No. A JPG has no transparency data, so nothing is marked transparent. Use a PNG or WebP that already has a transparent background.
Does my browser change the GIF?
Sometimes. A PNG at 100% gave byte-identical GIFs in Chrome 157, Firefox 155 and the WebKit build. Scaled copies, JPEG and lossy WebP files, and PNGs with soft transparency gave slightly different files, because each browser decodes and resizes the picture itself: the photo-like JPEG came out at 327,045, 327,466 and 330,086 bytes.
What is the largest image I can convert?
10,000 pixels on each side. A larger image is refused when you choose it, with its size in the message, and a GIF cannot record more than 65,535 pixels on a side in any case. A 4000 x 3000 JPEG converted in a median of 376 to 598 ms across the three engines.
How close are the GIF's colours to my original?
For flat artwork, exact: the four-colour logo came back with no difference at all. For the photo-like test image the average channel was off by 4.95 levels out of 255 and the worst pixel by 32, because 256 palette colours cannot cover a smooth gradient with grain.
Does a WebP convert the same as a PNG?
A lossless WebP does: the logo as lossless WebP and as PNG gave the same 7,877-byte GIF in all three engines. A lossy WebP is decoded by the browser first, so the same photo-like file gave 319,016 bytes in Chrome 157 and 320,648 bytes in Firefox 155 and the WebKit build.