# Compress images

- Check 16.04 · Images and multimodal search · Important
- Source: https://checklist-seo-geo.com/en/images-multimodal-search/compress-images
- Compress your images with the right quality settings, strip unnecessary metadata and automate it in WordPress, Shopify, Cloudflare or Next.js.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/images-multimodal-search/compress-images.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

Compressing an image means reducing its weight without visible degradation: choosing the right quality level, re-encoding with an efficient encoder and stripping unnecessary metadata (camera data, GPS coordinates, embedded thumbnails). A smartphone photo of several megabytes routinely drops to a few hundred kilobytes, or even less once resized. The task is to set the parameters, process the heaviest existing images and automate compression at every upload.

## Why it matters

A camera or smartphone saves its images at high quality and with plenty of metadata, to allow for editing. On the web, this surplus is invisible but still gets downloaded: it slows down display, especially on mobile, and uses up the visitor's bandwidth as well as the host's.

Two types of compression:

- **Lossy** (JPEG, WebP, AVIF): the encoder removes details the eye barely notices. The quality setting sets the trade-off. This is the mode for photos.
- **Lossless** (PNG, lossless WebP): the pixels stay identical, only the way the file is written is optimized. This is the mode for screenshots, diagrams and flat-color images.

Metadata also raises a privacy issue: a photo taken with a phone can contain the GPS coordinates of where it was taken. Conversely, rights metadata (author, copyright, license) is useful: Google can display the creator, credit and license read from the image's IPTC metadata in Google Images. Strip what is superfluous, keep the credits if you use them.

## What it improves

- **Load time and LCP** (Largest Contentful Paint): the main image arrives faster.
- **Lighthouse audit**: fewer files listed in the “Improve image delivery” insight.
- **Costs**: less bandwidth and storage.
- **Privacy**: no more GPS coordinates or device serial numbers published.
- **Rankings**: indirect effect, through Core Web Vitals. An over-compressed image, blurry or full of artifacts, does, however, hurt the click-through rate in Google Images: Google points out that sharp, high-quality images attract more.

## How to check

Spot the heaviest images on a page in the browser console:

```js
performance.getEntriesByType('resource')
  .filter((entry) => entry.initiatorType === 'img' || /\.(jpe?g|png|webp|avif|gif)(\?|$)/i.test(entry.name))
  .sort((a, b) => b.encodedBodySize - a.encodedBodySize)
  .slice(0, 10)
  .map((entry) => `${Math.round(entry.encodedBodySize / 1024)} KB  ${entry.name}`);
```

A value of 0 KB indicates an image served from the cache or from another domain without a `Timing-Allow-Origin` header: reload with the cache disabled or check it in the Network tab.

Check the metadata of a published image:

```bash
curl -s -o atelier.jpg https://example.com/images/atelier.jpg
exiftool -gps:all -make -model -serialnumber -copyright -artist atelier.jpg
```

Compliant result: no GPS line and no serial number; the credit fields present if you use them.

Weight benchmarks, which are conventions and not search engine rules:

| Image | Benchmark |
| --- | --- |
| Full-width main visual | under 200 KB |
| Content image | under 100 KB |
| List or grid thumbnail | under 30 KB |

PageSpeed Insights estimates the possible savings per file. Site-wide, Screaming Frog lists images over 100 KB (configurable filter in the Images tab).

## How to implement

### Before you start

Rules that apply everywhere:

1. **Resize first, then compress.** A 4,000-pixel image displayed at 800 wastes far more than any quality setting. See [size images appropriately](https://checklist-seo-geo.com/en/images-multimodal-search/size-images-appropriately).
2. **Always start from the original.** Recompressing an already compressed JPEG adds defects without saving much.
3. **A single lossy compression step.** If the CMS, a plugin and the CDN each compress, the image is degraded three times.
4. **Choose a suitable format.** See [use WebP/AVIF if appropriate](https://checklist-seo-geo.com/en/images-multimodal-search/use-webp-avif-if-appropriate).

Starting settings, to validate by eye on your own images (quality scales are not comparable from one encoder to another):

| Format | Starting setting | Note |
| --- | --- | --- |
| JPEG (MozJPEG encoder) | quality 75 to 85, progressive | 82 is the WordPress default |
| Lossy WebP | quality 75 to 82 | 86 by default in WordPress |
| AVIF | quality 50 to 65 depending on the encoder | slow encoding: do it on upload, not on the fly |
| PNG | quantization to 256 colors, then lossless optimization | for flat colors and screenshots |
| Lossless WebP | `-lossless` | alternative to PNG |

> **Tip:** to set your parameters, take five representative images (product photo, portrait, screenshot, diagram, visual with a gradient), compare them in Squoosh at several quality levels, and keep the lowest level with no visible defect at display size.

### On the command line

To process a folder before uploading or at deployment, with free tools (jpegoptim, pngquant, oxipng, cwebp, ExifTool):

```bash
# JPEG: maximum quality 82, progressive, metadata stripped
jpegoptim --max=82 --all-progressive --strip-all images/*.jpg

# PNG: reduce to 256 colors if quality stays good, then lossless optimization
pngquant --quality=70-90 --skip-if-larger --ext .png --force images/*.png
oxipng -o 3 --strip safe images/*.png

# WebP from the originals
for f in images/*.jpg; do cwebp -q 80 -metadata none "$f" -o "${f%.jpg}.webp"; done
```

To remove only the GPS coordinates and keep the rest:

```bash
exiftool -gps:all= -overwrite_original images/*.jpg
```

To remove everything except the author and copyright:

```bash
exiftool -all= -tagsFromFile @ -EXIF:Artist -EXIF:Copyright -XMP-dc:Creator -XMP-dc:Rights -overwrite_original images/*.jpg
```

In a Node.js project, the sharp library handles resizing, conversion and compression in a single pass, in a build script.

### Cloudflare

Versions: Cloudflare dashboard, November 2026: Polish on Pro, Business and Enterprise plans, image transformations on all plans.

**Polish** (Pro, Business and Enterprise plans), in the domain: `Speed > Settings > Image Optimization` ([optimization](https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization)).

- **Lossless**: pixels unchanged, most metadata stripped; about 21% reduction on average according to Cloudflare.
- **Lossy**: also removes image data, about 48% reduction on average according to Cloudflare, especially on JPEGs.

Cloudflare warns that several successive lossy compressions degrade the image more than they lighten it: if your images are already compressed on upload, prefer Lossless. Polish strips metadata, credits included: if you rely on IPTC metadata for credits in Google Images, test before enabling it.

**Image transformations** (`/cdn-cgi/image/quality=80,format=auto/...`) apply a quality of 85 by default and keep copyright metadata by default (`metadata=copyright`).

Purge the cache after enabling it: images already in the cache are not reprocessed.

### AWS

Versions: Amazon CloudFront and S3, Dynamic Image Transformation for Amazon CloudFront solution 8.x, November 2026.

CloudFront does not compress images (its Gzip and Brotli compression targets text files). Compress at upload or build time, or deploy the AWS “Dynamic Image Transformation for Amazon CloudFront” solution, which re-encodes images on demand with sharp from originals stored in S3, then caches them in CloudFront.

### Shared hosting

Shared hosting plans (and cPanel's “Images” tools) do not compress the images they serve. Compress before uploading via FTP, with Squoosh or the commands above, or hand the task over to a CMS plugin. Once compression at the origin is in place, Cloudflare's free plan adds no image compression: Polish requires a paid plan.

### WordPress

Versions: WordPress 6.4 to 7.1.

WordPress recompresses the intermediate sizes it generates: quality 82 for JPEG and 86 for WebP by default. To change these values:

```php
add_filter('wp_editor_set_quality', function (int $quality, string $mimeType): int {
    return match ($mimeType) {
        'image/jpeg' => 78,
        'image/webp' => 80,
        default => $quality,
    };
}, 10, 2);
```

The new values only apply to images generated afterwards: regenerate thumbnails (`wp media regenerate --yes` with WP-CLI) for existing images.

Since version 5.3, WordPress also scales down originals whose width or height exceeds 2,560 pixels (`big_image_size_threshold` filter).

Since WordPress 7.1, the block editor can generate intermediate sizes directly in the browser (client-side media processing, limited to recent Chromium browsers). After changing a setting, check the weight of the files generated by an upload from the block editor and by an upload from the Media Library.

To compress harder, convert formats and process the existing media library, a plugin is enough: ShortPixel, Imagify, EWWW Image Optimizer or Smush. Common settings:

- compression level: “lossy” or “glossy” for photos;
- keeping a copy of the original, so you can roll back;
- stripping EXIF metadata, unless you use IPTC credits;
- bulk processing of the media library, preferably at night on a large site.

Enable only one compression plugin at a time, and disable your cache plugin's image compression if it has one.

### Shopify

Versions: Shopify, all plans, November 2026.

Shopify recompresses and converts images on delivery through its CDN. Your lever is the original: upload files at the right dimensions (Shopify accepts up to 20 MB and 25 megapixels per image), already stripped of their GPS coordinates. Compression apps from the App Store alter the stored originals; check that they keep a backup.

### PrestaShop

Versions: PrestaShop 8 and 9.

In `Design > Image Settings`, set the JPEG quality and PNG compression applied to generated thumbnails, then regenerate thumbnails at the bottom of the same page. Test on one image type before regenerating the whole catalog, as the operation is slow.

### Magento

Versions: Magento Open Source and Adobe Commerce 2.4 (up to 2.4.9).

The JPEG quality of resized catalog images is set in `Stores > Configuration > Advanced > System`, “Image Upload Configuration” section, “Quality” field (80 by default). After changing it, regenerate the image cache (`bin/magento catalog:images:resize`). For finer compression, use a dedicated module or a CDN.

### Drupal

Versions: Drupal 10 and 11.

In `Configuration > Media > Image toolkit`, set the JPEG quality applied by the GD library to image styles. Then flush the generated images of the affected styles (`Configuration > Media > Image styles`, “Flush” action) so that they are recreated.

### Wix

Versions: Wix and Squarespace, all plans, November 2026.

Automatic: Wix recompresses images on delivery. So does Squarespace. Upload clean originals, at useful dimensions, without GPS coordinates.

### Webflow

Versions: Webflow, all plans, November 2026.

Webflow optimizes images on delivery and offers conversion to lighter formats in the Assets panel. Compress files before uploading anyway: an original of several megabytes slows down the editor and may be served as is in some cases (downloads, sharing images).

### Laravel

Versions: Laravel 11 to 13, spatie/image-optimizer 1.x, Intervention Image 3 and 4.

The spatie/image-optimizer package drives jpegoptim, pngquant, optipng, cwebp and other binaries installed on the server:

```php
use Spatie\ImageOptimizer\OptimizerChainFactory;

$optimizerChain = OptimizerChainFactory::create();

$optimizerChain->optimize(storage_path('app/public/images/atelier.jpg'));
```

With Intervention Image, set the quality at encoding time: `$image->save($path, quality: 80, progressive: true)` in version 4, `$image->toJpeg(80, progressive: true)` in version 3. Run the processing in a queued job after the upload.

### Next.js

Versions: Next.js 15 and 16.

`next/image` encodes at quality 75 by default. Since Next.js 16, only the qualities declared in the `qualities` list in `next.config.js` are served (by default, only 75); any other value is rounded to the closest one in the list:

```js
module.exports = {
  images: {
    qualities: [60, 75, 85],
  },
};
```

Then, image by image: `<Image src={photo} alt="…" quality={85} />` for a visual where fine detail matters.

### Nuxt

Versions: Nuxt 4 with the @nuxt/image 2 module; same syntax in Nuxt 3 with @nuxt/image 1.

`<NuxtImg src="/images/atelier.jpg" quality="80" format="webp" />`, or a global value in `nuxt.config.ts` (`image: { quality: 80 }`).

### Astro

Versions: Astro 5 to 7.

The `Image` component accepts `quality`, either as a preset (`low`, `mid`, `high`, `max`) harmonized across formats, or as a number from 0 to 100:

```html
<Image src={atelier} alt="TIG welding station in the workshop" quality="mid" />
```

## Common mistakes

- **Compressing without resizing**: a compressed 6,000-pixel image is still too heavy.
- **Lossy compression applied several times**: a plugin, the CMS and the CDN in series produce blur and artifacts.
- **Overwriting originals without a backup**: no way to roll back or re-encode later in a better format.
- **Pushing quality too low on main visuals and product photos**: noisy flat areas, blotchy skin, blurry text.
- **Compressing screenshots as JPEG**: smudged text. Prefer PNG or lossless WebP.
- **Publishing the GPS coordinates** of photos taken with a phone, especially at a home or a private place.
- **Erasing required credits**: some licenses require keeping the author. See [check rights and credits](https://checklist-seo-geo.com/en/images-multimodal-search/check-rights-credits).

## Frequently asked questions

### What quality level should I choose for a JPEG?

A setting between 75 and 85 suits most web photos; WordPress uses 82 by default for its thumbnails. Validate by eye on a few representative images, at their display size: a visual with a gradient, a portrait, a product photo. Quality scales vary from one encoder to another, so the same number does not produce the same result in two tools.

### Does image compression improve SEO?

Indirectly. Lighter images speed up display, LCP in particular, and contribute to Core Web Vitals, one signal among many others. Compression is not a ranking factor in itself. Beware of the opposite excess: Google points out that sharp, high-quality images attract more clicks in Google Images, so an overly degraded image can cost you traffic.

### Should EXIF data be removed from images?

Yes for unnecessary or sensitive data: GPS coordinates, camera model and serial number, embedded thumbnails. They add weight to the file and can reveal a private location. Keep rights metadata, however, such as author, copyright or license, if you use it: Google can display this IPTC information in Google Images.

### Are WordPress compression plugins necessary?

No, but they save time. WordPress already recompresses thumbnails, at quality 82 for JPEG, and scales down originals over 2,560 pixels. A plugin such as ShortPixel, Imagify or EWWW Image Optimizer adds stronger compression, conversion to WebP or AVIF and processing of the existing media library. Enable only one at a time.

## Resources

- [web.dev: compress images](https://web.dev/articles/compress-images) and [Learn Images course](https://web.dev/learn/images)
- [Chrome for Developers: image delivery insight](https://developer.chrome.com/docs/performance/insights/image-delivery)
- [Google Search Central: image license metadata](https://developers.google.com/search/docs/appearance/structured-data/image-license-metadata)
- [Cloudflare: Polish compression](https://developers.cloudflare.com/images/polish/compression/) and [transform via URL](https://developers.cloudflare.com/images/transform-images/transform-via-url/)
- [WordPress: wp_editor_set_quality filter](https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/) and [big_image_size_threshold](https://developer.wordpress.org/reference/hooks/big_image_size_threshold/)
- [Next.js: qualities configuration](https://nextjs.org/docs/app/api-reference/components/image)
- [Astro: image reference](https://docs.astro.build/en/reference/modules/astro-assets/)
- [ExifTool: documentation](https://exiftool.org/)

Next steps: [size images appropriately](https://checklist-seo-geo.com/en/images-multimodal-search/size-images-appropriately) and [use srcset and sizes](https://checklist-seo-geo.com/en/images-multimodal-search/use-srcset-sizes).
