Photoshop like transparency in Nuke

You can use TIFF or PSD files with alpha channel in Nuke to get Photoshop like results.
Or you can use PNG files with direct transparency the same way.

This is useful in general, but especially for composting additional layer of Matte Paint or Overpaint (for example: extra clouds for the background, extra color/texture details for existing render AOVs etc.).

Photoshop the one which calculates the whole thing incorrectly (because all of its math is based on already gamma corrected color values, so the math behind it is just simply wrong).
Still, sometimes you want to get the same look that you (or somebody else) created in PS.

This is how:

  • Save your 8 or 16 bit/channel TIFF or PSD with an extra alpha channel containing the transparency data.
    You can use 8 or 16 bit/channel PNG with direct transparency as well. Works the same way in Nuke.
  • Load the file in Nuke with the usual Reader node.
    (Use the correct Input Transform (Color Space) of course.)
  • Create a Gamma node
    This is the main „trick”. You have to linearize the Alpha channel.
    • channels: alpha
    • value: 0.454
  • Add a Premult node

Done 🙂

This will give you a pretty close match with the Photoshop look.
Unfortunately, you will see some color differences at the semi-transparent parts (again the calculation in Nuke is the correct one), but it’s pretty close.

Left side: default. Right side: with the corrected alpha channel (gamma: 0.454).

The difference for this particular image with a black background:

As you can see the after a difference merge node, the maximum difference for the whole image in Level (aka lightness) is: 0.0047825
So, some differences are still remain, but it is pretty low.
Visually:


For TIFF and PSD in Photoshop:

You can convert direct transparency to an alpha channel in Photoshop with a few clicks:

  • Select the layer
  • Use the Layer -> Layer Mask -> From Transparency command
  • Go the Channels panel and duplicate the mask
  • Rename the duplicated mask to alpha
  • Apply or delete the mask for the layer
  • Don’t use any background layer (or it can be pure white as well)
  • Save the file as .tif or .psd
    Make sure the Save Transparency option is off for TIFFs!

Cheers, D

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.