nothings / stb

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

stb_image incorrectly sees png as 16bit. #1585

Closed marauder2k7 closed 7 months ago

marauder2k7 commented 7 months ago

Describe the bug When loading a PNG file stb incorrectly sees it as a 16bit image, when it is an 8bit SRGB file

To Reproduce Steps to reproduce the behavior:

using this call with an 8bit SRGB file exported from substance designer if (stbi_is_16_bit(path.getFullPath().c_str()))

it returns true, yet renderDoc and a few other programs we have checked it with report it as 8bit format.

am i using this incorrectly?

nothings commented 7 months ago

works for me on my PNGs. you'll have to provide an image that it doesn't work on.

marauder2k7 commented 7 months ago

sandy_d

this is one of the images it does it on.

how im testing the image in renderdoc image

nothings commented 7 months ago

exiftool reports this as "Bit Depth: 16" and ffprobe reports "Video: png, rgba64be(pc)" (64 = 4 channels * 16 bits). I conclude it's a 16-bit image, and whatever other methods you were using to check for 16-bitness are invalid.

marauder2k7 commented 7 months ago

image render doc

nothings commented 7 months ago

please don't report renderdoc bugs to me, i don't make renderdoc