Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear color space (16bit, from 0.0... to 1.0...) #819

Closed
0x4E69676874466F78 opened this issue Aug 24, 2022 · 6 comments · Fixed by #2090
Closed

Linear color space (16bit, from 0.0... to 1.0...) #819

0x4E69676874466F78 opened this issue Aug 24, 2022 · 6 comments · Fixed by #2090
Labels
enhancement New feature or request

Comments

@0x4E69676874466F78
Copy link

Is it possible to process in a 16bit linear color space?

@0x4E69676874466F78
Copy link
Author

0x4E69676874466F78 commented Aug 24, 2022

And saving in 16bit format (e.g PNG supports 16bit).

@0x4E69676874466F78 0x4E69676874466F78 changed the title Linear color space (16bit, 0.0...-1.0...) Linear color space (16bit, from 0.0... to 1.0...) Aug 24, 2022
@RunDevelopment
Copy link
Member

Currently, no. While we do store images as float32 numbers, numerous operations convert to uint8. So we could add support for saving an image as 16bit, but it wouldn't achieve much.

However, I think that we should support this. Last time I brought this up, I believe that the consensus was that it's a niche use case that isn't a priority.

I also want to point out that many upscaling architectures use uint8 in their APIs, so there is nothing we can do about that.

@0x4E69676874466F78
Copy link
Author

@RunDevelopment okay.
It's just that I'm thinking of trying to create my own model and I think that it's better to work in linear space, and it's better to save normal maps in 16bit.

@0x4E69676874466F78
Copy link
Author

0x4E69676874466F78 commented Aug 24, 2022

Also there is another case of "LDR to HDR" models.

@0x4E69676874466F78
Copy link
Author

@RunDevelopment

I also want to point out that many upscaling architectures use uint8 in their APIs, so there is nothing we can do about that.

Do you know which ones support floating point?

@joeyballentine
Copy link
Member

Do you know which ones support floating point?

All the ones we support in PyTorch use floating point I think. But yeah, many of the nodes in chaiNNer force us to convert to uint8 (thanks to opencv), so this isn't realistic unless we replace those with different functions. Also, saving at different bit depths will theoretically be possible once we add encoding settings to the image save node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants