Good image work is less about one perfect setting and more about understanding the destination. This guide gives you a repeatable path and points out the trade-offs worth checking.

Compression is a viewing-context decision

There is no universal quality number that makes every image small and perfect. A product photo with tiny labels, a soft portrait, and a flat-color screenshot fail in different ways. Start by deciding where the image will appear and how large viewers will actually see it.

Lossy formats remove information that their encoders judge less noticeable. The best result is therefore the smallest file that still looks clean at its intended display size—not the smallest number you can produce.

Resize before you squeeze quality

Pixel dimensions often matter more than the quality slider. A 5000-pixel camera photo is wasteful in an article column that never exceeds 1200 pixels. Resize a copy to the largest realistic display width, keep the aspect ratio locked, and only then tune compression.

This order protects detail because the encoder has fewer pixels to describe. It also reduces browser memory use and makes comparisons faster.

  • Keep the untouched original.
  • Match pixel dimensions to the largest intended placement.
  • Use 2× display size only when high-density presentation genuinely needs it.

Choose the format by image content

JPG remains dependable for photographs and broad compatibility. WebP frequently produces a smaller photo at comparable visual quality and can preserve transparency. PNG is valuable for transparency, diagrams, interface screenshots, and crisp flat graphics, but a photographic PNG can be unnecessarily large.

Converting a JPG to PNG does not restore the detail that JPG compression already removed. It only changes the container and often makes the file larger.

Use a deliberate comparison loop

Begin around 80–88% for JPG or WebP, export once, and inspect the result at 100%. Look at hair, text edges, gradients, dark shadows, and high-contrast boundaries. If those areas remain clean, lower the setting in small steps.

Do not judge only from a scaled-down preview. Compare the generated byte size too. A tiny quality reduction can sometimes save a useful amount; at other times it barely changes the file.

A practical website example

Imagine a 4032×3024 product photograph that weighs 4.8 MB. If its article placement is 1200 pixels wide, first resize it to 1200×900. Export a WebP around 82%, then compare it with a JPG around 84%. Choose the smaller result only if labels, texture, and color transitions still look right.

For a catalog, repeat the same dimensions and quality target across similar photographs. Consistency improves layout stability and makes later maintenance predictable.

Questions people ask

Does image compression always reduce dimensions?

No. Compression can change encoding quality without changing pixel dimensions; resizing changes dimensions.

What quality should I start with?

For photographic JPG or WebP, 80–88% is a practical inspection range, not a guarantee.

Why is my PNG still large?

PNG is lossless and photographs contain complex color variation. WebP or JPG may suit that content better.