4 comments on “Colour Space

  1. Pingback: Gamma & contrast | The Compositor Mathematic

  2. hello! i love your blog, it has some simple to the point explanations of pretty complicated things! Please post more! Also wanted to ask if it possible to have a precise gamma conversion from linear into rec709, applying the precise function of the rec709 space gamma? Surely it should be possible in nuke?

    • Hi Stepan,
      Thanks, it’s been a long time since I’ve written an article here. Unfortunately it takes a long time to research and write on each topic and life gets in the way!
      Nuke has built in conversions (in the colorspace node, and in the read & write nodes). Conveniently the gamma curve is specified in the node – ‘rec709 (~1.95)’ So the linear -> rec709 conversion is a gamma correction of approximately 1.95. That is approximate though, so entering that in a gamma node won’t give you a perfect result.
      Here is the exact formula, where ‘Value’ is one of the colour channels (as taken from this Nuke forum thread)-

      if value >= 0.018:
      return (1.099 * (value**0.45)) – 0.099
      else:
      return 4.5 * value

      So here’s a Nuke expression applying that formula –

      Expression {
      expr0 “r>=0.018?(1.099 * pow(r, 0.45) – 0.099):r*4.5”
      expr1 “g>=0.018?(1.099 * pow(g, 0.45) – 0.099):r*4.5”
      expr2 “g>=0.018?(1.099 * pow(g, 0.45) – 0.099):r*4.5”
      name Expression1
      label “lin -> rec709”
      }

      I hope that helps.
      -Gene

  3. Ah amazing! Thank you for that! Basically i’m a colourist that does a little bit of nuke work as-well. The main problem is that I am completely self taught and a lot of the times it’s a little bit confusing trying to figure these things out. A lot of the times if you understand the maths behind something but don’t know code or expressions it’s hard to understand them. I’ve noticed that your last blog post was quite some time ago, but the topics that you have covered here are very throughfully explained, which is pretty rare to find! Hope you will have some inspiration to write here again!

Leave a comment