Image optimization

How to reduce image file size without obvious quality loss

Smaller images can upload faster and use less bandwidth, but the best result comes from combining sensible dimensions, an appropriate format, and visual inspection—not simply dragging quality to the minimum.

Start with the destination

A useful image is large enough for its final display, but not unnecessarily larger. Before touching a slider, find the pixel dimensions and file-size limit required by the website, email service, marketplace, or messaging app. A 4000-pixel camera photo is wasteful when it will only appear 800 pixels wide.

Keep the untouched original. Optimization should create a delivery copy, not replace the best source you have.

  • Record the maximum width and height you need
  • Check whether the destination accepts JPG, PNG, or WebP
  • Note any upload limit in MB
  • Work from the original rather than a previously compressed copy

Resize before aggressive compression

Reducing dimensions removes pixels the viewer would never see at the intended display size. This often saves more space with fewer visible defects than forcing a full-resolution image through a very low quality setting.

Maintain the aspect ratio unless you intentionally want to crop or distort the image. If a platform requires a square, cropping to a square composition usually looks better than stretching a rectangle.

Choose compression quality by inspection

Quality numbers are encoder settings, not universal percentages of visual quality. An 80 setting can look excellent on one photo and reveal artifacts on another. Detailed foliage, hair, text, and smooth gradients deserve extra attention.

Create a result, open it at normal size and at 100% zoom, then look for blockiness, halos around edges, banding in skies, and smeared fine detail. If those defects matter at the actual viewing size, raise quality slightly.

  • Begin around 80 for a JPG or lossy WebP
  • Compare the output with the original side by side
  • Check faces, text, edges, and gradients
  • Stop compressing once savings are small but defects become visible

Format can matter as much as quality

Photographs normally compress efficiently as JPG or lossy WebP. Screenshots and graphics with few colors may remain clearer as PNG. Transparent assets need PNG or WebP because JPG has no alpha channel.

Changing a JPG to PNG usually increases size and does not recover lost detail. Changing a detailed PNG photograph to JPG can save substantial space, but transparency is flattened and lossy compression is introduced.

A repeatable optimization workflow

Resize a copy to the maximum dimensions needed, choose a format suited to the content, and apply moderate compression. Check the image visually and verify its pixel dimensions and byte size. Test the actual upload before processing a whole batch, because platform-specific recompression can change the final appearance.

  • Resize
  • Select format
  • Compress moderately
  • Inspect output
  • Test at the destination
  • Keep the original