# How Resizo Works

## Browser-based processing

When a user drops an image onto Resizo, the file is read into memory using the `FileReader` and `Blob` APIs. The bitmap is decoded into an `HTMLImageElement` or `ImageBitmap`, drawn onto a `<canvas>` at the target dimensions, and re-encoded with `canvas.toBlob()`. The resulting blob is offered as a download via an object URL. The file never crosses a network boundary.

For batch jobs, Resizo uses a `Web Worker` pool to process multiple images in parallel without blocking the UI, then assembles the outputs into a ZIP using a client-side ZIP encoder. The ZIP is also generated in memory and downloaded directly.

## Privacy model

- **No upload.** There is no server-side endpoint that accepts image data.
- **No persistence.** Images live only in the active browser tab. Closing or refreshing the tab clears them.
- **No telemetry on file content.** Resizo does not transmit filenames, dimensions, or metadata to any analytics service.
- **Works offline.** After the first page load, the site functions with the network disconnected.
- **Open behavior.** All processing is plain JavaScript visible in the page source; network activity can be verified with the browser's DevTools Network tab (it stays empty during editing).

## Supported formats

| Format | Input | Output | Notes |
| --- | --- | --- | --- |
| JPG / JPEG | Yes | Yes | Lossy. Best for photos. Quality slider 1–100. |
| PNG | Yes | Yes | Lossless. Supports transparency. Larger files. |
| WebP | Yes | Yes | Modern format, ~25–35% smaller than JPG at equal quality. |
| GIF | Yes | No (export as PNG/JPG/WebP) | First frame is used; animation is not preserved. |
| HEIC / HEIF | Browser-dependent | No | Safari decodes natively; other browsers require pre-conversion. |
| SVG | No | No | Vector format; resizing is a viewBox change, not a raster operation. |

## Quality and interpolation

Resizing in the Canvas API is governed by two settings that Resizo exposes:

- `imageSmoothingEnabled` — set to `true` for photos so edges are interpolated; set to `false` for pixel art and screenshots to keep hard edges crisp.
- `imageSmoothingQuality` — `"high"` is the default, which selects a higher-order resampling kernel (browser-implementation-defined, typically Lanczos or bicubic). `"medium"` and `"low"` trade quality for speed during large batch jobs.

For large downscales (more than ~3×), Resizo performs the resize in two passes to reduce aliasing. JPG and WebP output use a user-controlled quality value; PNG uses lossless DEFLATE.
