bvibber / hdrfix

tool for converting HDR screenshots to SDR with suitable tone-mapping
114 stars 10 forks source link

"Unsupported pixel format" error with JXR files captured by Windows Game Bar. #1

Closed gofaster closed 3 years ago

gofaster commented 3 years ago

Windows 10 Build 19043 Game Bar version 5.721.6282.0

user@dev:~/src/hdrfix/target/release$ ./hdrfix --version
hdrfix converter for HDR screenshots 0.1.0

user@dev:~/src/hdrfix/target/release$ ./hdrfix ~/msfs.jxr msfs.jpg
/home/user/msfs.jxr -> msfs.jpg
Error: Unsupported pixel format

Attachments in zip: msfs.jxr -> the HDR file msfs.png -> the tonemapped SDR file that the Game Bar also saves.

Thank you. gamebar-hdr.zip

bvibber commented 3 years ago

I took a quick peek and added a debug statement, and it's coming back as:

PixelFormat64bppRGBAHalf

which is good! I should be able to work with that. 16 bits per channel, not sure if it's the 10-bit range or a full 16-bit range or what but that's easy enough to figure out once I get into the data.

I'll take a look tonight if I have a chance. Thanks for the bug report & the sample file! :D

bvibber commented 3 years ago

Oh right "half" here means half-float. So 16-bit float. I might need to find something to convert those to 32-bit floats, but I can do it manually in a pinch.

bvibber commented 3 years ago

I think I got it working! ^ see commit above

gofaster commented 3 years ago

Awesomely quick work. Really nice conversion results and tweaking parameters. Does this deserve a version number bump?