Skip to content

Conversation

@jonnyawsom3
Copy link
Contributor

@jonnyawsom3 jonnyawsom3 commented Apr 27, 2025

Description

The APP14 tag is now added to RGB(XYB), CMYK and YCCK JPEGs, as it is required in some decoders.
Using --chroma_subsampling will now correctly subsample XYB's Blue channel.
XYB is now 444 by default to allow JPEG XL Transcoding.
YCbCr now uses 444 by default and 420 at Quality 80/Distance 1.9 or lower.
Adaptive Quantization is disabled at Quality 90/Distance 1 or lower for non-XYB.
RGB is now used at Quality 100/Distance 0 for RGB input (PNG), overridden by XYB.

Fixes #122
Fixes libjxl/libjxl#3512
Fixes libjxl/libjxl#3605

Pull Request Checklist

  • CLA Signed: Have you signed the Contributor License Agreement (individual or corporate, as appropriate)? Only contributions from signed contributors can be accepted.
  • Authors: Have you considered adding your name to the AUTHORS file?
  • Code Style: Have you ensured your code adheres to the project's coding style guidelines? You can use ./ci.sh lint for automatic code formatting.

Please review the full contributing guidelines for more details.

@monad0
Copy link
Contributor

monad0 commented Apr 27, 2025

consider removing personal notes and fixing comment formatting

@Galaxy4594
Copy link
Contributor

Galaxy4594 commented Apr 27, 2025

Build issues should be solved, I've managed to successfully compile on my Ubuntu VM.

@jonnyawsom3 jonnyawsom3 marked this pull request as draft April 29, 2025 01:57
@jonnyawsom3
Copy link
Contributor Author

Marking as Draft while we do testing and cleaning up.

@jonnyawsom3 jonnyawsom3 changed the title Fixed XYB subsampling, RGB APP14 marker and 420 quality threshold APP14 Marker, Better Subsampling and High Quality RGB May 1, 2025
@jonnyawsom3 jonnyawsom3 marked this pull request as ready for review May 2, 2025 07:14
@jonnyawsom3 jonnyawsom3 changed the title APP14 Marker, Better Subsampling and High Quality RGB APP14 Marker, Better Subsampling and High Quality Improvements May 2, 2025
@ampaze
Copy link

ampaze commented Jun 2, 2025

I am eagerly awaiting the fix for the APP14 Marker (to make XYB work with Safari). Is there something missing or could this be merged?

@ampaze
Copy link

ampaze commented Jun 3, 2025

Testing this PR I noticed that just adding --xyb creates files that are bigger than without. I was under the impression that using XYB should generate smaller files?

I am using the following commands

cjpegli input.png output.jpg -d 4.5 --chroma_subsampling 420
cjpegli input.png output-xyb.jpg -d 4.5 --chroma_subsampling 420 --xyb

@jonnyawsom3
Copy link
Contributor Author

Split into separate PRs #135, #136 and #137.

@jonnyawsom3 jonnyawsom3 closed this Jun 3, 2025
@jonnyawsom3
Copy link
Contributor Author

Testing this PR I noticed that just adding --xyb creates files that are bigger than without. I was under the impression that using XYB should generate smaller files?

I am using the following commands

cjpegli input.png output.jpg -d 4.5 --chroma_subsampling 420
cjpegli input.png output-xyb.jpg -d 4.5 --chroma_subsampling 420 --xyb

XYB only subsamples the Blue channel, and is most likely higher quality than YCbCr. The difference between them could be due to a number of factors, including the image content itself.

@ampaze
Copy link

ampaze commented Jun 4, 2025

XYB only subsamples the Blue channel, and is most likely higher quality than YCbCr. The difference between them could be due to a number of factors, including the image content itself.

I was suspecting something like that. It would have been more intuitive if the distance parameter was consistent between the two modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants