Automattic / Automattic/jetpack

Enhancement: Image Optimizer is too aggressive for some images

Open
#41,232 1 comment 0 reactions 0 assignees View on GitHub
[Boost Feature] Image CDN [Experiment] AI labels added [Feature Group] Content Management [Feature] Photon [Plugin] Boost [Plugin] Jetpack [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

None / Other

### What

While using the Cover block, I'd like the background image to not be compressed as much (or not at all)

### How

Context

I thought I had found a bug. I have a Cover block with a background image (2560px width) and the size is set to "full size". Looks good in the editor, but on the frontend, the compression is terrible. See example below. Look closely at the shirt (you might have to open the images). The compression is more obvious the larger the image.

| compressed | Jetpack compression off |
|--------|--------|
| ![Image](https://github.com/user-attachments/assets/e9281873-c6f4-43ab-b73a-79aaa1f04577) | ![Image](https://github.com/user-attachments/assets/13b45b2d-5ce8-48c1-b7e6-1530a17b4326) |

As a result, I had to turn off image compression, but that affects all images on the site. I think Jetpack is miscalculating the size of the background image and Jetpack doesn't know that the image gets bigger as the viewport is enlarged. The image is an `img` element, not a CSS background-image.

Snippet

```







```

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported quality loss with the WordPress Cover block using a large full-size background image, comparing the frontend result with Jetpack compression disabled. Trace how the image optimizer handles the Cover block's img element; done means preserving better quality for this background image without disabling compression for all site images.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
performance, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.