I briefly looked at the code and seems there is no linearization happening before downsampling. u8/channel color data will always have some gamma for obvious reasons.
I.e. the results of the downsampling using this crate are just always wrong (as there are no u16/f16 or f32 images supported where there is enough bits to store data linearly in the pixel buffer).
See http://www.ericbrasseur.org/gamma.html for a detailed explanation.
This is the test image from above website:

The expected result:

And what the code in this crate produces instead:

I briefly looked at the code and seems there is no linearization happening before downsampling.
u8/channel color data will always have some gamma for obvious reasons.I.e. the results of the downsampling using this crate are just always wrong (as there are no
u16/f16orf32images supported where there is enough bits to store data linearly in the pixel buffer).See http://www.ericbrasseur.org/gamma.html for a detailed explanation.
This is the test image from above website:

The expected result:

And what the code in this crate produces instead:
