MrKepzie/openfx-io

GenericOCIO, Readers and Writers should handle premultiplication correctly

devernay opened this issue · 0 comments

The unpremult option was implemented for color correction nodes using OCIO (OCIOCDLTransform, OCIOColorSpace, OCIOFileTransform, OCIOLogConvert, see #12), and openfx-misc color-correction nodes (NatronGitHub/openfx-misc@2e076ff).

But GenericOCIO, readers and writers are still not handling premultiplication correctly.
For example, ReadOIIO outputs images with associated (premultiplied) alpha most of the time (see ReadOIIOPlugin::getClipPreferences()), but GenericOCIO treats them as non-associated (unpremultiplied).

Plugins to fix are:

  • ReadOIIO - alpha is not always associated. Should there be a "premult" checkbox?
  • ReadEXR - do we still have to maintain it? how do I check wether the EXR file is premultiplied or not? Should there be a "premult" checkbox?
  • all writers (WriteOIIO, WriteEXR, WritePFM, WriteFFmpeg): should they faith the premultiplication state of the input clip, or should there be a "unpremult" checkbox saying that the input is premultiplied? Should they be able, for formats that support it (EXR and TIFF, AFAIK), to store unpremultiplied data too? Anyway, they have to unpremult for formats that don't support alpha (PFM, FFmpeg).

see also:
http://wiki.blender.org/index.php/User:Sobotka/Associated_and_Unassociated_Alpha