

# 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.

## How it works

Size change (%) = (1 − output bytes ÷ original bytes) × 100.

## 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.

## Worked examples

### Typical task

Resize a 1600 × 1200 image to width 800 with proportions locked. Height becomes 1200 × 800 ÷ 1600 = 600 pixels. The pixel count falls from 1,920,000 to 480,000.

### A different case

If a 1,000,000-byte file exports at 600,000 bytes, the reduction is 40%. If it exports at 1,100,000 bytes, it is 10% larger; a format conversion does not guarantee savings.

## Interpreting your result

Keep the original file and inspect fine text, transparency, and dimensions before replacing it. JPEG flattens transparency onto white.

## Limits and assumptions

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.

### Why can the output be larger?

Format, image content, dimensions, and encoder settings affect bytes. PNG conversion can increase size even after other changes.

### Will an animation remain animated?

No. Animated inputs export a single still frame. Keep the original for animation.

### Are photos uploaded for compression?

No. Decoding and encoding happen in your browser. Download the output explicitly; the page does not save a server copy.



- [MDN: using images with canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images)

## Continue with a related task

- [Guides](https://taskpencil.com/guides/)

- [Spirograph playground](https://taskpencil.com/tools/spirograph-playground/)

- [AI Video Prompt Builder](https://taskpencil.com/tools/ai-video-prompt-builder/)


- [Reduce image size while checking quality](https://taskpencil.com/guides/reducing-image-size-while-checking-quality/)


