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

Can RgbaOutputFile use 32-bit float? #237

Closed
mfeemster opened this issue Jul 6, 2017 · 1 comment
Closed

Can RgbaOutputFile use 32-bit float? #237

mfeemster opened this issue Jul 6, 2017 · 1 comment
Labels
Question A question or a request for help.

Comments

@mfeemster
Copy link

I have the source building and running and am following the examples to learn how to write an EXR image. I notice that RgbaOutputFile hard codes the format of each RGBA channel to type HALF.

I was wondering if there is a way to set it to FLOAT to use full 32-bit precision for each channel?

Thanks.

@cary-ilm cary-ilm added the Question A question or a request for help. label Jun 13, 2019
@cary-ilm cary-ilm added this to the Needs Attention milestone Jun 29, 2019
@peterhillman
Copy link
Contributor

Apologies for the very late response. In short: there isn't a way.

The RgbaOutputFile class only accepts half-float pixel data, which is why it uses HALF storage within th file. For RgbaOutputFile to support float data, there would also have to be a 'float' version of the Rgba type to provide the pixel data.

For anything other than writing half-float RGBA in a single part, the General Interface for Scanline Based Files should be used, via the OutputFile or MultiPartOutputFile classes. See the Reading and Writing OpenEXR image Files document for details. These interfaces are more versatile. For example, you can omit the A alpha channel completely, write it as half float and RGB as 32 bit float, or separate it into a separate part so it can be skipped when it isn't required.

Providing float support in RgbaOutputFile (and presumably RgbaInputFile as well) seems like it would duplicate a lot of effort for a small use-case without providing any extra functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question A question or a request for help.
Projects
None yet
Development

No branches or pull requests

3 participants