Log2Lin

Whenever you read a clip into a script, it is automatically converted to Nuke’s native color space, which is 32-bit per channel RGB, a linear format. This conversion takes place even if the clip you read in is in the Kodak Cineon format, which is a logarithmic format. The reverse of this conversion, called a lin-to-log conversion, also automatically takes place when you write the processed element back out of the script - that is, Nuke automatically converts it back into a Cineon element.

Nuke uses the Kodak-recommended settings when making Cineon conversions in either direction. It’s rare that you would want to override these settings, but if it becomes necessary you can use the Log2Lin node. If you do, you should also check raw data (or set colorspace to linear) in the Read and Write node controls to skip the automatic conversion.

Inputs and Controls

Connection Type

Connection Name

Function

Input

unnamed

The image sequence to convert.

mask

An optional image to use as a mask. By default, the shift is conversion to the non-black areas of the mask.

At first, the mask input appears as triangle on the right side of the node, but when you drag it, it turns into an arrow labeled mask. If you cannot see the mask input, ensure that the mask control is disabled or set to none.

Control (UI)

Knob (Scripting)

Default Value

Function

Log2Lin Tab

channels

channels

rgb

The conversion is only applied to these channels.

If you set this to something other than all or none, you can use the checkboxes on the right to select individual channels.

operation

operation

log2lin

Sets whether the conversion is from or to Cineon log colorspace:

log2lin - from Cineon colorspace.

lin2log - to Cineon colorspace.

black

black

95

Sets the value in the Cineon file that is converted into 0.

reset

N/A

N/A

Click to reset the black value to the default setting.

ignore

ignore_black

disabled

When enabled, the black offset is not subtracted so that the conversion is a pure log function.

white

white

685

Sets the value in the Cineon file that is converted into 1.

reset

N/A

N/A

Click to reset the white value to the default setting.

gamma

gamma

0.6

Sets the exposed light level multiplier to calculate the film density.

reset

N/A

N/A

Click to reset the gamma value to the default setting.

mask

N/A

disabled

Enables the associated mask channel to the right. Disabling this checkbox is the same as setting the channel to none.

maskChannelInput

none

The channel to use as a mask. By default, the conversion is limited to the non-black areas of this channel.

inject

inject

disabled

Copies the mask input to the predefined mask.a channel. Injecting the mask allows you to use the same mask further downstream.

invert

invert_mask

disabled

Inverts the use of the mask channel so that the conversion is limited to the non-white areas of the mask.

fringe

fringe

disabled

When enabled, only apply the effect to the edge of the mask.

When disabled, the effect is applied to the entire mask..

(un)premult by

N/A

disabled

Enables the associated channel to the right. Disabling this checkbox is the same as setting the channel to none.

unpremult

none

The image is divided by this channel before being processed, and multiplied again afterwards.

If you are using premultiplied input images, you may want to check (un)premult by and select rgba.alpha here. This will simulate applying the conversion before the premultiplication was done. It is the same as adding an Unpremult node before this node and a Premult node after, but allows you to work faster if you’re only using one node.

If you are using unpremultiplied input images, you should leave this set to none.

invert

invert_unpremult

disabled

Inverts the use of the (un)premultiply channel.

mix

mix

1

Dissolves between the original image at 0 and the full conversion at 1.

Step-by-Step Guides

Overriding the Default Cineon Conversion