# Image optimizer

Canonical interactive tool: https://taskpencil.com/tools/image-optimizer/

Optimize a raster image locally: resize it, reduce its RGB palette, and export JPEG, PNG, or WebP without uploading the image to a server.

## Instructions

1. Choose or drop a browser-supported raster image, up to 30 MB and 16 million pixels.

2. Choose an output format and quality. JPEG and WebP use lossy quality controls; PNG is lossless after resizing and palette changes.

3. Enter pixel dimensions. Keep original proportions is on by default. Optionally reduce the RGB palette. Select Grayscale to convert colors to gray shades while retaining transparency.

4. The preview and file-size comparison update automatically after you finish adjusting a setting. Wait for the output, then download. Reset settings restores the original dimensions and default output settings.

## Size comparison and example

Size change (%) = (1 − output bytes ÷ original bytes) × 100. For example, 1 MB to 0.6 MB is 40% smaller. Aspect-locked height = original height × new width ÷ original width, rounded to the nearest pixel.

## Limits

Output dimensions must be whole numbers from 1 to 8192 pixels, totaling at most 16 million pixels. Available formats depend on browser encoders. SVG is excluded. Animated inputs export a single still frame. JPEG flattens transparency onto white. Grayscale uses rounded weighted RGB brightness (0.2126 R + 0.7152 G + 0.0722 B) and preserves alpha. Palette reduction uses a uniform RGB grid (or black and white), preserves alpha, and does not produce indexed PNG files. Lossy encoding can introduce additional colors. Metadata is not copied deliberately; color profiles and orientation depend on browser decoding. Compression can produce a larger file, especially when converting to PNG. This uses browser-native encoders, rather than Squoosh’s full codec suite.
