mozilla / mozjpeg

Improved JPEG encoder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chroma subsampling implicitly set for certain QFs in version 4.

NoraH2004 opened this issue · comments

I compressed color images with different quality factors and looked at their DCT values.
The chroma subsampling setting is left as default. However, I found that chroma subsampling is still applied for certain QFs.

(Specifically: EITHER for QFs of 75 and below (tested 50, 64, 75), OR higher than 75 (tested 95, 99, 100), for both modes, baseline and progressive.)

I also tested mozjpeg version 3.0 and did not observe this behavior, so it must have been introduced recently.

I was not able to locate it in jcparam.c. Can you give me a reference to this behavior in the source code?
Moreover, I was wondering if this is intended to happen with the default settings, as it is not mentioned in the release notes.

Thanks,
Nora

This behavior is limited to the cjpeg demo too. It's here: 3a86fa5

Thanks for your answer and clarification.

From what I see, it was introduced in v3.2. In my opinion, it is an unfortunate feature. It breaks backward compatibility with cjpeg from previous releases / libjpeg-turbo and "silently" changes the value of an essential parameter without the developer noticing.

Best,
Nora

I don't treat cjpeg as a public API. It's a deprecated outdated demo tool. You should use MozJPEG as a library compiled into other libjpeg-based programs.