# Premult

> Multiply colour by alpha.

| Node | Premult |
|---|---|
| Menu | Merge › Premult |
| **Names in each format** | |
| .oink comp (JSON) | `"type": "OC_N_premult"` |
| .nk script | `Premult` ([how .nk import works](/docs/nuke-users/nk-import)) |
| Python | `nuke.createNode("Premult")` |
| Assistant (MCP) | `create_node(type="Premult")` |
| Tab search | `premult` |

![Premult properties](/shots/nodes/premult@2x.webp)

## Inputs and outputs

| Port | Name | Type |
|---|---|---|
| input 0 | Image | image |
| output 0 | Image | image |

## Knobs

Panel tab **Premult**, in panel order.

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `channels` | multiply | menu | `rgb` | rgba, rgb, alpha, all, none |  | Layer the op applies to: rgb, rgba, alpha, all, none, <layer> or <layer>.<ch> |
| `alpha` | by | menu | `rgba.alpha` | rgba.alpha, none | `alpha` | Channel to multiply / divide by (none = off) |
| `invert` | invert | bool | `false` |  | `invert` | Multiply / divide by 1 - alpha |

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

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `gl_color` | Viewer Controls Color | float ×3 | `0, 0, 0` | 0 to 1 |  |  |
| `postage_stamp_frame` | Static Frame | int | `1` | -2147483648 to 2147483647 |  |  |
| `lifetimeStart` | Lifetime Start | int | `0` | -2147483648 to 2147483647 |  |  |
| `lifetimeEnd` | Lifetime End | int | `100` | -2147483648 to 2147483647 |  |  |
| `useLifetime` | Use Lifetime | boolean | `false` |  |  |  |
| `cached` | Cached | boolean | `false` |  |  |  |
| `bookmark` | Bookmark | boolean | `false` |  |  |  |
| `dope_sheet` | Dope Sheet | boolean | `false` |  |  |  |
| `clone_group` | Clone Group | string |  |  |  |  |
| `link_source` | Link Source | string |  |  |  |  |
| `link_overrides` | Link Overrides | string |  |  |  |  |
| `split_views` | Split Views | string |  |  |  |  |
| `mask_channel` | Mask | string | `none` |  |  | Mask channel, e.g. rgba.alpha (none = no mask) |
| `invert_mask` | Invert | boolean | `false` |  | `invert_mask` |  |
| `inject` | inject | boolean | `false` |  |  | Copy the mask into mask.a for nodes downstream |
| `fringe` | fringe | boolean | `false` |  |  | Only apply the effect at the edges of the mask |
| `unpremult` | (Un)premult by | enum | `none` | none, rgba.alpha |  |  |
| `invert_unpremult` | invert | boolean | `false` |  |  | (Un)premultiply by 1 - alpha |
| `mix` | Mix | float | `1` | 0 to 1 | `mix` |  |

## 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).


---
Sources: opencomp_core/nodes/color/premult.py, opencomp_electron/src/components/properties/knobSchema.ts, opencomp_core/nk/mapping.py
