google / google/jpegli

Output image looks blurry if using XYB and chroma subsampling other than 4:4:4

Open
#122 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
401
Forks
66
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I tried to compress a couple of images with XYB colorspace and different chroma subsampling settings, but found them all to be very blurry except for 4:4:4, and it seems that Luma is subsampled as well. Without using XYB there is no such problem.

Is this a bug? Or it is not recommended to use XYB and chroma subsampling together?

**To Reproduce**
Compress an image using jpegli with args given below.

**Expected behavior**
The output image should be about as crisp as the input image.

**Screenshots**
Test image: https://r0k.us/graphics/kodak/kodak/kodim21.png

`cjpegli kodim21.png kodim21_444.jpg --xyb --chroma_subsampling=444 -q 50`

![Image](https://github.com/user-attachments/assets/a89fabf4-84b1-42d2-97b2-c2351f6b6d57)

`cjpegli kodim21.png kodim21_420.jpg --xyb --chroma_subsampling=420 -q 50` looks blurry compared with 4:4:4.

![Image](https://github.com/user-attachments/assets/b57a863a-761b-4cd1-b2fe-36b1c1f8b19c)

`cjpegli kodim21.png kodim21_422.jpg --xyb --chroma_subsampling=422 -q 50` looks blurry and stretched horizontally.

![Image](https://github.com/user-attachments/assets/394dab87-92ba-4590-aebb-3e02a02a00a4)

`cjpegli kodim21.png kodim21_440.jpg --xyb --chroma_subsampling=440 -q 50` looks blurry and stretched vertically.

![Image](https://github.com/user-attachments/assets/0ebdae5e-50f5-407a-9e94-7467b8fd526c)

**Environment**
- OS: Windows
- Compiler version: Not applicable. I downloaded the encoder from libjxl's latest CI artifacts https://github.com/libjxl/libjxl/actions/runs/14097851256
- CPU type: x86_64
- cjxl/djxl version string: JPEG XL encoder v0.12.0 b1842b9 [_AVX2_,SSE4,SSSE3,SSE2]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.