IMAGE→GIF local · no upload

Technical notes

How the converter works

No server, no queue, no upload. Here is the exact path an image takes from your disk to a GIF file, including the parts that make GIF look the way it does.

1. The browser decodes the image

The file picker, drag-and-drop handler, and paste handler all produce File objects. The converter first asks createImageBitmap() to decode the file. That API applies the EXIF orientation by default, so a portrait photo from a phone is not sideways. If the browser cannot decode the file that way, the converter falls back to an <img> element and draws that to a canvas. The fallback is what makes SVG and ICO work in browsers whose bitmap decoder rejects them.

The decoded frame is drawn into a canvas at the selected output width. The height follows the first image's aspect ratio. Additional images are fitted with either contain (letterbox) or cover (crop).

2. Pixels are reduced to a GIF palette

GIF is an indexed-color format: each frame references a table of at most 256 colors. The encoder samples the frames and builds a palette with median-cut quantization. On a photo, that is a real reduction: a gradient sky may contain thousands of distinct colors and has to be represented by a few hundred.

The Colors setting changes the palette size. Fewer colors make a smaller file, but also make banding more visible. The default Auto uses 256 colors for photo-like images and 128 for flat graphics.

3. Dithering trades noise for smoother gradients

When a gradient is squeezed into a small palette, hard bands appear. Dithering mixes neighboring palette colors to approximate the missing tones. This converter uses Floyd–Steinberg error diffusion for photo-like images. It looks noisier up close, but the gradient reads more smoothly at normal size.

Flat graphics usually look better without dithering: solid areas stay solid, and edges stay clean. That is why the quality control has an Auto mode instead of forcing one choice for every image.

4. Each frame is compressed with LZW

GIF uses LZW compression, a lossless dictionary coder, on each frame's indexed pixels. The encoder also crops unchanged edges of a frame and marks them transparent, which is why a slideshow with a static background can be smaller than the raw frame count suggests.

This is still not video compression. There is no motion prediction between frames, and every frame carries its own pixel data. A long, detailed animation will grow quickly.

5. The file is assembled as GIF89a

The output uses the GIF89a version, which adds animation, frame delays, transparency, and the Netscape looping extension. Delays are written in hundredths of a second, so the tool rounds your frame time to the nearest 10 ms. The file ends with the GIF trailer and is handed to the browser as a Blob.

6. The expensive part runs in a worker

Palette generation, dithering, and LZW compression run in a dedicated Web Worker. The page transfers one frame's pixel buffer at a time to the worker, waits for it to be accepted, and then releases the buffer on the main thread. The UI stays responsive while the worker does the encoding.

The worker is a static file served from this domain. It has no network access to your images and no upload endpoint to send them to.

image-to-gif.com converts images to GIF in the browser; files are never uploaded.

What the tool deliberately does not do

References