You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some deep thinking and discussion with people who know more color
than me, I have become convinced that you *almost always* want to make
sure to un-premultiply colors (i.e. divide by alpha) before doing color
space transformations with OCIO, and then re-multiply by alpha (to get
back to "associated alpha") immediately after the color transformation.
To support this,
* For the ImageBufAlgo color transformation functions, change the default
value of the `unpremult` parameter from `false` to `true`.
* `oiiotool --autocc` will do the unpremult/premult steps surrounding any
automatic color transformations that it does upon input and output.
* `oiiotool --colorconvert` and the various `--ocio` commands now take
an optional modifier `:unpremult=1` which will cause the conversion to
be internally bracked by a unpremult/premult step (when you do this,
you no longer need an explicit --unpremult and --premult on the
command line).
* oiiotool now issues warnings for cases where it has a good reason to
think you might be double-unpremulting (for example, if you do both
--unpremult and follow it by a --colorconvert:unpremult=1).
Later, we'll stage a second part of this where we change the default
value for unpremult= to be 1, so that the modifier is not needed (at which
point you REALLY don't want the explicit --unpremult/--premult, or it will
be wrong).
On the whole, I think this makes the situation less error prone for
casual users. Most oiiotool command lines should just use --autocc and
then not need to worry about any explicit use of `--colorconvert` or
`--unpremult/--premult`. For the rare case when more control is needed,
the individual commands and modifiers can be used.
Note that for oiiotool, `--autocc` is not on by default. If you want
images auto-converted to linear space and ouputs auto-converted from
linear to the desired output space, you need to use `--autocc`.
0 commit comments