mozjpeg icon indicating copy to clipboard operation
mozjpeg copied to clipboard

Use more precise chroma subsampling

Open kornelski opened this issue 11 years ago • 5 comments

There are few tricky problems in chroma subsampling: http://www.glennchan.info/articles/technical/chroma/chroma1.htm

e.g. libjpeg averages chroma of black pixels with chroma of neighboring color pixels, which causes darkened or desaturated edges. Even most naive blending with weighting by saturation gives a noticeable improvement:

https://github.com/pornel/jpeg-compressor#subsampling

kornelski avatar Mar 06 '14 00:03 kornelski

@pornel I'll maybe implement this soon. I looked at (the disabled) do_fancy_downsampling option, and it uses DCT scaling... which is crap. I'll look at something better which won't break ABI either.

dwbuiten avatar Aug 14 '14 15:08 dwbuiten

Possibly related: https://en.wikipedia.org/wiki/Helmholtz–Kohlrausch_effect

My idea: Saturation affects perceived lightness, so when pixels lose saturation due to chroma subsampling, it could be partially fixed by adjusting luma to compensate for the loss.

kornelski avatar Aug 27 '15 21:08 kornelski

Proposed technique tested using image in #193. It's not ideal, but better than nothing.

Nether Poppleton

kornelski avatar Dec 01 '15 00:12 kornelski

Was this closed intentionally?

njdoyle avatar May 19 '16 14:05 njdoyle

edited Accidentally, but that's ok, my experimental code is not suitable for a PR.

kornelski avatar May 19 '16 15:05 kornelski