AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.74k stars 431 forks source link

Allow FileTransforms from ICC profile to not clamp #1915

Open SRHMorris opened 7 months ago

SRHMorris commented 7 months ago

In some cases I need to have some form of interop with ICC profiles. I'm currently creating a FileTransform with the ICC profile and adding it as a scene referred color space in my config (converting reference space to ACES2065-1 and using the builtin transform for to convert to XYZ D65).

The problem is that FileFormatICC.cpp adds RangeOps to clamp the color components to be less than 1. According to comments this is because the ICC spec specifies the transfer functions operate in the range 0 to 1. However this makes these transforms fairly useless for anything except as part of a display transform.

Similarly to CDL having the style option to not clamp, it would be very useful to have the option to disable this clamping for ICC profiles. Similarly it seems like it clamps to zero for a simple power curve, it would be nice to be able to specify negative behaviour (such as mirroring around zero (sign(x) * pow(abs(x), y)).

A pretty common case for me is having the ICC profile describe a just a matrix transform (a linear space). In that case the clamp serves no purpose at all.

Originally this issue was about allowing the display created from an ICC profile to be extended range. I still think that would be useful, but it seems like the underlying issue is the RangeOps added to the FileTransform.