Image Compression Explained: Formats, Quality Settings and Tools
What image compression actually does, how JPEG, PNG, WebP and AVIF differ, and a repeatable workflow for smaller files that still look right.
What is image compression?
A digital photo is a grid of pixels, and each pixel needs several bytes to describe its colour. A 12-megapixel image (4000 × 3000 pixels) would take about 36 MB uncompressed at 3 bytes per pixel. Compression is what turns that into the 2–6 MB file your phone actually saves. The smaller the file, the faster it uploads, loads and fits through email limits. It also costs less to store and serve.
There are two families of methods. Lossless compression finds patterns and stores them more compactly, so the decoded image is identical to the original. Lossy compression permanently removes information that matters least to human vision, which is why it can shrink files far more. The trade-offs are covered in detail in lossy vs lossless compression.
How the main formats compress images
Understanding the mechanism explains why each format suits different content.
- JPEG splits the picture into 8 × 8 pixel blocks, converts each block into frequency components (a discrete cosine transform), then rounds the less visible components more aggressively. It also often stores colour at lower resolution than brightness (chroma subsampling), because we notice brightness detail more. Lower quality means coarser rounding, which eventually shows up as blocky edges and smudged colour.
- PNG is lossless. It predicts each pixel from its neighbours (filtering) and then packs the result with DEFLATE. It handles flat colours and sharp edges well but is inefficient for photographs. A PNG can also use a palette of up to 256 colours, which is how colour-reduction tools shrink graphics dramatically.
- WebP uses predictive coding derived from the VP8 video codec for lossy images and a separate lossless mode, plus transparency and animation. Google's published study found lossy WebP files 25–34% smaller than comparable JPEGs at equivalent SSIM quality, and lossless WebP 26% smaller than PNG.
- AVIF stores images using the AV1 video codec inside a HEIF-style container. It often produces smaller files than WebP or JPEG at similar visual quality, supports transparency and wide colour, but takes longer to encode.
For a side-by-side decision guide, see JPEG vs PNG vs WebP vs AVIF.
Which format should you choose?
| Your image | Best choice | Why |
|---|---|---|
| Photograph for a website | WebP (JPEG as fallback) | Smaller than JPEG at similar quality, displayed by all current major browsers |
| Photo for email, forms or print shop | JPEG | Accepted everywhere |
| Logo, icon, screenshot, diagram | PNG, or lossless WebP | Sharp edges and flat colour stay crisp |
| Needs transparency | PNG or WebP | JPEG cannot store transparency |
| Very large hero photo, bandwidth matters | AVIF with WebP/JPEG fallback | Often the smallest file for photographs |
| Simple animation | Animated WebP, or video | GIF files are large and limited to 256 colours |
Need to change format? Use the JPG/PNG to WebP converter, PNG to JPG or WebP to JPG tools. They run in your browser, so the files are not uploaded.
What quality setting should you use?
Quality numbers are not percentages of the original, and they do not mean the same thing across formats. As a practical guide, JPEG quality around 75 is a widely used default (Google's WebP study also treats 75 as the generally recommended JPEG level), and 80–85 is a safe choice when detail matters. WebP is commonly set around 75–80. AVIF uses a different scale, so values around 50–60 are a typical starting point. Always judge by eye at the size the image will be shown.
- Quality 90+ keeps almost everything but produces large files. Use it only for masters or print.
- Quality 75–85 is the usual sweet spot for web, email and online shops.
- Quality 60–70 suits thumbnails and previews where fine detail is not needed.
- Below 60 usually shows visible artefacts on faces, skies and gradients.
The JPG compressor and WebP compressor let you set this with a slider and show the exact saving.
Resize first, then compress
Dimensions usually matter more than quality. A 4000-pixel-wide photo displayed in a column that is 800 pixels wide carries about 25 times more pixels than needed (4000 × 3000 versus 800 × 600). Shrinking it removes data without any visible loss at the display size, and then compression has far less to encode.
Rule of thumb: export at about 2× the largest displayed width if you want sharp results on high-density screens, and no more. Use the image resizer to set exact pixel sizes or a percentage, or the crop tool when you also want to change the framing. If a form demands an exact limit, the target-size compressor chooses the quality for you.
A repeatable image workflow
- Keep the original. Store the full-resolution file untouched.
- Crop and resize to the largest size you will actually display.
- Choose the format using the table above.
- Compress at quality 75–85 (or reduce colours for PNG graphics) and compare against the original at 100% zoom.
- Check the result: faces, text edges, skies and gradients show artefacts first.
- Name and describe the file with a short descriptive filename and meaningful alt text.
- Serve it properly on the web with correct dimensions and lazy loading, covered in responsive images.
Why image size matters for speed and SEO
Images are frequently the largest element on a page, which makes them the usual cause of a slow Largest Contentful Paint. Google's Core Web Vitals treat an LCP of 2.5 seconds or less as good, and the thresholds apply at the 75th percentile of real visits. Google also publishes image guidance for Search: use descriptive filenames and alt text, supported formats, and responsive markup. See how images affect Core Web Vitals and optimising images in WordPress.
Compression is only one part of page speed, and speed is only one part of ranking. Relevant, original content still matters most.
Privacy: where does the compression happen?
Many online compressors upload your files to a server. That is convenient but means a copy of your photo leaves your device. An in-browser tool, such as the ones on this site, does the work on your own computer with your browser's image encoders. Learn what to look for in how to choose a free image compressor.
Common mistakes to avoid
- Compressing the same JPEG repeatedly. Each lossy save adds artefacts, so always start from the original.
- Saving photographs as PNG. The files are often several times larger than JPEG or WebP.
- Uploading full camera resolution and letting the page shrink it with CSS.
- Ignoring transparency. Converting a transparent PNG to JPEG fills it with a solid colour.
- Over-compressing logos and text. Use PNG, lossless WebP or SVG instead.
- Forgetting that email and upload limits apply to the whole message. See how to reduce photo size for email.
Try it now: Compress JPG
Free, private and runs in your browser. Nothing is uploaded.
Open Compress JPGFrequently asked questions
Sources and further reading
- Google Developers: WebP, an image format for the web
- Google Developers: WebP compression study
- MDN: Image file type and format guide
- W3C: Portable Network Graphics (PNG) Specification
- AOMedia: AV1 Image File Format (AVIF) specification
- web.dev: Web Vitals
- Google Search Central: Image SEO best practices
External links open the original source. We cite primary or official documentation for factual claims and re-check them when we update an article. See our editorial policy.
Keep reading
- Lossy vs Lossless Compression: What’s the Difference?Lossy compression discards detail for smaller files; lossless keeps every pixel. Learn how each works, when to use which and how to avoid generation loss.
- JPEG vs PNG vs WebP vs AVIF: Which Image Format Should You Use?Compare JPEG, PNG, WebP and AVIF on file size, quality, transparency and browser support, with a simple rule for choosing the right image format.
- How to Compress Images Without Losing Visible QualityA practical workflow to shrink JPG, PNG and WebP images with no visible quality loss: resize first, pick the right format, set the right quality.
- Image Optimization for Core Web Vitals: Fix LCP and CLSHow images affect LCP and CLS, with fixes: right size and format, fetchpriority, no lazy-loading the hero, and set dimensions on every image.
- How to Choose the Best Free Image Compressor in 2026A checklist for choosing a free image compressor: privacy, quality control, formats, limits and honest results. Learn what separates good tools from bad.
- Image Compression for WordPress: A Practical GuideHow to optimise images for WordPress: sizes, formats, quality, lazy loading and the 2560px threshold, plus a pre-upload workflow that keeps your site fast.