Open kornelski opened 10 years ago
@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.
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.
Proposed technique tested using image in #193. It's not ideal, but better than nothing.
Was this closed intentionally?
edited Accidentally, but that's ok, my experimental code is not suitable for a PR.
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