Skip to content
All references

Images reference

Image Compression & Quality

Understand target file sizes, lossy quality, dimensions, transparency and practical checks before publishing images.

Reduce an image for the way it will be displayed

Image optimization has two separate decisions: how many pixels are needed and how those pixels are encoded. A large photograph displayed as a small card often benefits more from resizing than from an aggressive quality setting. A screenshot with fine text can need a different format from a photograph even when their dimensions match.

Work from a retained original and compare actual exports. A quality slider is an encoder preference, not a target number of kilobytes. Detailed foliage, noise and smooth illustrations compress differently, so no fixed slider position guarantees the same reduction for every picture.

  1. Find the destination's display dimensions and consider the pixel density you need. Avoid uploading a full camera image for a small thumbnail.
  2. Resize with proportions locked. Use PNG for exact graphic edges or transparency, and compare JPEG or WebP for a photograph.
  3. Export one candidate, inspect its byte size and view it at its intended display size. Look at text, edges, gradients and faces.
  4. Adjust quality or dimensions only as far as the real requirement demands, then keep the source and chosen export as separate files.

Understand why halving dimensions removes three quarters of the pixels

Example input

2400 × 1600 = 3,840,000 px

Expected result

1200 × 800 = 960,000 px

Both dimensions are halved, so the pixel count becomes one quarter. That substantially changes the amount of image data, but it does not promise that the encoded file will be exactly one quarter of its original byte size. Compare the real download with the destination's limit rather than estimating its size from dimensions alone.

Check before you continue

  • Re-encoding a lossy export repeatedly can compound visible damage. Return to the original when trying a different size or quality.
  • JPEG cannot store transparent pixels. Check the background chosen during conversion instead of discovering a white box after publishing.
  • Metadata and visible private details are separate concerns. Inspect metadata and use a flattened image-redaction export when personal details inside the picture must be covered.

9 of 9 entries

Size

Pixels and file size are different

2400 × 1600 pixels = 3,840,000 pixels
Encoded bytes depend on content and format.

Two images with identical dimensions can have very different file sizes. Fine texture, noise, transparency, metadata and encoder settings affect the result.

Quality

Quality is an encoder setting

JPEG/WebP quality: 0.15 … 0.95

Quality values are hints to the browser encoder, not standardized visual scores. A value of 0.8 does not mean that 80% of the original detail is preserved.

Size

A target size is a goal

Target: 200 KB
Result: 241 KB → reduce dimensions or accept more loss.

Some images cannot reach a small target at the allowed quality floor. The compressor reports this instead of claiming success. Here, one KB means 1,024 bytes.

Dimensions

Resize before pushing quality too low

4000 × 3000 → 1600 × 1200
60% of the original side lengths removed.

Reducing both dimensions reduces the number of pixels substantially. Choose dimensions suitable for the image's display size; enlarging later cannot restore lost detail.

Transparency

JPEG has no alpha transparency

Transparent PNG → JPEG → white background

JPEG cannot preserve transparent pixels. The compressor fills them with white. Choose WebP when a transparent background is needed and check support in the destination application.

Quality

Avoid repeated lossy exports

Original → final settings → one export

Each JPEG or lossy WebP re-encoding can discard more information. Work from the original when comparing different quality levels rather than compressing a previous result repeatedly.

Metadata

Metadata can be removed

Image pixels ≠ EXIF location, camera settings or copyright fields

Canvas re-encoding usually does not preserve original metadata. Keep the original when those fields matter, and inspect the actual exported file rather than assuming every metadata field was removed.

Publishing

Check the destination size

Displayed width × device pixel ratio ≈ useful source width

A small thumbnail rarely needs a full camera-resolution source. Balance a sharp result against transfer size, and test the actual page on a mobile connection.

Publishing

Watermarks change the pixel content

Original + visible label → new PNG

A visible watermark adds pixels and can increase file size. It is a label, not access control or copyright registration. Compress the final watermarked copy if the destination has a size limit.