-1

I'm working in Nuke with 32bit float image. I would like to apply math expression (can be TCL or Python) to convert values to 16bit half float.

Any ideas what math formula can I use?

Can anyone please help with equation to "compress" 32 bit float to 16 bit half float?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
KLB
  • 45
  • 5

1 Answers1

1

Unlike Blackmagic Fusion or Apple Shake, there's no magical knob in The Foundry NUKE allowing you to change file's bit depth.

enter image description here

If you wanna change a bit depth of an input image, you have to render your sequence using a new bit depth value for datatype property in Write node.

Here's how your code should look like:

import nuke

write = nuke.nodes.Write(file='/Users/nuker/file.%03d.exr', file_type='exr')
write['datatype'].setValue('16')

P.S.

Not all file types support 16-bit half-float depth. But OpenEXR does support it. And I have to mention that all color grading and color correction operations in NUKE are performed in 32-bit float space, even if your files are 8-bit or 16-bit.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220