Oink
Nodes

Premult

Multiply colour by alpha.

raw .md
NodePremult
Type idOC_N_premult
MenuMerge › Premult
Nuke classPremult
Codeopencomp_core/nodes/color/premult.py

Premult properties

Inputs and outputs

PortNameType
input 0Imageimage
output 0Imageimage

Knobs

Panel tab Premult, in panel order.

KnobLabelTypeDefaultRange / valuesNuke knobDescription
channelsmultiplymenurgbrgba, rgb, alpha, all, noneLayer the op applies to: rgb, rgba, alpha, all, none, <layer> or <layer>.<ch>
alphabymenurgba.alphargba.alpha, nonealphaChannel to multiply / divide by (none = off)
invertinvertboolfalseinvertMultiply / divide by 1 - alpha

Other knobs (Python, .nk and the assistant; not on the panel)

KnobLabelTypeDefaultRange / valuesNuke knobDescription
gl_colorViewer Controls Colorfloat ×30, 0, 00 to 1
postage_stamp_frameStatic Frameint1-2147483648 to 2147483647
lifetimeStartLifetime Startint0-2147483648 to 2147483647
lifetimeEndLifetime Endint100-2147483648 to 2147483647
useLifetimeUse Lifetimebooleanfalse
cachedCachedbooleanfalse
bookmarkBookmarkbooleanfalse
dope_sheetDope Sheetbooleanfalse
clone_groupClone Groupstring
link_sourceLink Sourcestring
link_overridesLink Overridesstring
split_viewsSplit Viewsstring
mask_channelMaskstringnoneMask channel, e.g. rgba.alpha (none = no mask)
invert_maskInvertbooleanfalseinvert_mask
injectinjectbooleanfalseCopy the mask into mask.a for nodes downstream
fringefringebooleanfalseOnly apply the effect at the edges of the mask
unpremult(Un)premult byenumnonenone, rgba.alpha
invert_unpremultinvertbooleanfalse(Un)premultiply by 1 - alpha
mixMixfloat10 to 1mix

Nuke equivalent

Imports from and exports to Nuke's Premult. The standard Nuke mask knobs (channels, mask, invert, (un)premult, mix) are mapped too.

Nuke knobs not in this list import as a knob of the same name, or are kept unchanged for export. See .nk import.

Examples

Open these from Help › Examples…, or from the ? menu in this node's Properties panel.

  • Copy an alpha between streams (examples/channel/copy_alpha.oink): Copy takes rgba.alpha from its A input (the CandleGlass render) and writes it into the B stream (the Desk photo), then Premult multiplies the colour by that alpha. The same pattern moves any channel between streams.
  • Premultiplied colour: Unpremult, grade, Premult (examples/merge/premult_handling.oink): Colour corrections on a premultiplied render go between Unpremult and Premult, so edges keep their colour. PrismsLenses.exr is premultiplied with alpha 0 but rgb above 0 in places (glows); those pixels are left alone by Unpremult (alpha 0).

On this page