Quality clinic
How to Compress an Image Without Making It Look Bad
Good compression removes bytes the viewer will not miss. The goal is not the smallest possible file—it is the lightest file that still looks clean at its real display size.

Start with the three biggest wins
Resize first
Export close to the maximum displayed dimensions. A 4000-pixel original is wasteful in a 700-pixel content column.
Choose the right format
Use JPEG or WebP for photographs, PNG when lossless transparency or crisp flat graphics justify it, and AVIF when supported by the workflow.
Tune by sight
Lower quality gradually while viewing the image at its actual size. Stop before artifacts become distracting.
Recognize compression damage
- Blockiness
- Square patches in skies, walls, shadows, or soft gradients.
- Ringing
- Bright or dark outlines around text, hair, product edges, and high-contrast shapes.
- Banding
- Visible steps instead of a smooth color transition.
- Texture loss
- Skin, fabric, foliage, and food begin to look waxy or smeared.

A repeatable export test
- Create three exports at different quality settings.
- Compare edges, faces, gradients, fine texture, and transparent boundaries.
- View them at the size visitors will see—not enlarged for forensic inspection only.
- Test on a phone as well as a desktop.
- Choose the smallest version with no meaningful visual penalty.

Protect important details
Images containing small text, interface screenshots, line art, logos, or sharp diagrams often need lossless compression. Photographs tolerate lossy compression better, but faces and smooth skies reveal defects early.
Remove unnecessary metadata when appropriate, avoid repeatedly saving a lossy file, and always keep a clean master. Every extra lossy generation can compound damage.
Practical target
There is no universal quality number. Encoders use different scales, and image complexity varies. Set a page-level image budget, prioritize the largest above-the-fold image, lazy-load content images below it, and judge quality against the real use case.
Separate resizing from compression
Resizing changes pixel dimensions. Compression changes how those pixels are stored. The order matters: crop and resize for the real placement first, then choose the format and quality level. Compressing a 6000-pixel camera file while leaving its dimensions untouched still makes visitors download image data the page never displays.
Do not upscale a small original to meet an arbitrary export target. Larger dimensions created by interpolation do not restore missing texture. They may only make the file heavier.
Match the format to the visual material
| Image type | Starting choice | Inspect closely |
|---|---|---|
| Photograph | WebP, AVIF, or JPEG | Faces, gradients, hair, fine foliage |
| Screenshot with text | PNG or lossless WebP | Ringing and colored fringes around letters |
| Transparent product | WebP with alpha | Halos, shadows, hair and glass edges |
| Logo or icon | SVG where suitable | Raster blur and unnecessary canvas space |
Format choice is not a contest with one permanent winner. A diagram and a portrait contain different kinds of visual information. Give the encoder a format suited to that information before adjusting a quality slider.
Run a three-file experiment
Export the same resized source at high, medium, and lean settings. Put all three inside the actual page component. Check the largest desktop use, then the phone view. The middle version often wins: the heaviest file may offer no visible improvement, while the leanest shows damage around edges, skin, or gradients.
Reference copy for comparison, not automatically the publishing choice.
The smallest file that stays clean in its real placement.
Reveals the point where defects become distracting.
Compare at 100% and at the final display size. Extreme zoom helps identify an artifact, but visitors judge the complete picture. Keep the lighter export when the difference is invisible in normal use.
Diagnose the defect before changing settings
Text looks fuzzy
Do not keep raising a photographic quality slider blindly. Crop unused margins, export at the required dimensions, and test PNG or lossless WebP. Interface captures and diagrams need crisp edges more than photographic compression.
A sky shows stripes
Smooth gradients expose aggressive compression. Raise quality, compare another modern encoder, or add very subtle controlled noise before export if the editing workflow supports it. Inspect the result on the screen where it will appear.
Transparent edges look dirty
Check the mask before blaming the format. Old background color can remain inside semi-transparent pixels. Clean that contamination, preserve genuine soft transitions, then export with settings that protect alpha detail.
The file is still heavy
Inspect pixel dimensions, empty transparent canvas, metadata, and accidental lossless settings. A visually simple image should not require a multi-megabyte web file at ordinary content dimensions.
The image becomes worse after every edit
You may be recompressing an already lossy file. Return to the original master, complete the edits, and create one final delivery export. Repeated JPEG-style saves can accumulate damage.
The complete page decides whether compression worked
Even efficient files can produce a slow page when dozens load immediately. Give the main above-the-fold image appropriate priority. Lazy-load images farther down. Declare width and height so the layout does not jump. Supply responsive source sizes so a narrow phone does not receive a wide desktop original.
Check the page over a realistic mobile connection. Watch when the leading image becomes visible, whether scrolling stays stable, and how much data transfers before interaction. The winning export protects the intended detail while helping the page respond quickly—not merely the file that looks smallest in a folder.
Final publishing check
- Correct crop and pixel dimensions.
- Format chosen for the image’s visual structure.
- No obvious blockiness, halos, ringing, or banding.
- Descriptive filename and useful alternative text.
- Responsive sources configured when the layout needs them.
- Untouched master stored outside the delivery workflow.
Resize, convert, then test
Resize the image to its delivery dimensions first. Use the WebP quality guide to pick a compression setting, and check Transparent PNG vs WebP when you need to preserve transparency.
Editorial note
Checked against primary references
This guide was written and reviewed by Yassine El Mernissi for CleanImg Online. Last reviewed: September 29, 2026.