Skip to content

NaN generated on HDR inverses #158

@remia

Description

@remia

In the image dataset there are a few generated images with NaN, I specifically identified these:

images-v2/cubes/inverse_on_input/cms/pq2000_InvOutput.Academy.P3-D65_2000nit_in_P3-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cms/pq4000_InvOutput.Academy.P3-D65_4000nit_in_P3-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq1000_InvOutput.Academy.Rec2100-D65_1000nit_in_Rec2100-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq2000_InvOutput.Academy.P3-D65_2000nit_in_P3-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq2000_InvOutput.Academy.P3-D65_2000nit_in_Rec2100-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq2000_InvOutput.Academy.Rec2100-D65_2000nit_in_Rec2100-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq4000_InvOutput.Academy.P3-D65_4000nit_in_P3-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq4000_InvOutput.Academy.P3-D65_4000nit_in_Rec2100-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq4000_InvOutput.Academy.Rec2100-D65_4000nit_in_Rec2100-D65_ST2084.exr
images-v2/cubes/inverse_on_input/cube_faces/pq500_InvOutput.Academy.Rec2100-D65_500nit_in_Rec2100-D65_ST2084.exr

This seem to be due to a division by zero happening in the inverse compression function, the way it's been dealt with in OCIO was to change the lim < 1.0001 to lim <= 1.0001 in both forward and inverse direction.

For debugging purposes, you should be able to trigger the issue using RGB [0.40898755, 0.0, 0.6531319] with InvOutput.Academy.P3-D65_4000nit_in_P3-D65_ST2084.ctl

This change also seem to significantly improve the HDR roundtrip, eg. on this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions