nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.84k stars 7.72k forks source link

stbir_resize_uint8_srgb should return same color space with src input. #1343

Closed ghost closed 1 year ago

ghost commented 2 years ago

hi, i found stbir_resize_uint8_srgb decode srgb image to linear space before process, but when process done, data don't encode back to srgb color space. I think there should exist one option or explanation to notify user know current image data under which colorspace.

karrih commented 2 years ago

Do you have an example? There is another GitHub issue featuring the same function (https://github.com/nothings/stb/issues/1338), which shows an example where the output values are returned correctly in sRGB.

I believe this is the relevant part in the source code: https://github.com/nothings/stb/blob/af1a5bc352164740c1cc1354942b1c6b72eacb8a/stb_image_resize.h#L1768

rygorous commented 1 year ago

stb_image_resize definitely converts back from linear to sRGB when writing by default, unless you explicitly ask it not to. No repro provided and it's been months so I'm closing this issue.