the math can be used in a Iridas .ilut lut.
Thanks for the response guys


________________________________
From: James Etherington <james.ethering...@gmail.com>
To: Nuke user discussion <nuke-users@support.thefoundry.co.uk>
Sent: Wednesday, June 22, 2011 1:05 AM
Subject: Re: [Nuke-users] linear to rec709 math?


Can you not just use a Colorspace node?



On Wed, Jun 22, 2011 at 1:42 AM, Ben Dickson <ben.dick...@rsp.com.au> wrote:

Based on
>http://www.catr.cn/radar/itur/201007/P020100714493171220847.pdf
>
>..I ended up with:
>
>
>def from_linear_light(self, value):
>   """Specified in the Rec.709 PDF::
>
>       V = 1.099*L^0.45 - 0.099 for 1 >= L >= 0.018
>       V = 4.500*L              for 0.018 > L >= 0
>   """
>
>   if value >= 0.018:
>       return (1.099 * (value**0.45)) - 0.099
>   else:
>       return 4.5 * value
>
>def from_rec709(self, value):
>   """Rec.709 doesn't specify a reverse transform, so this is
>   manually reversed from the from_linear_light method.
>   """
>
>   if value >= 0.081:
>       return ((value + 0.099) / 1.099) ** (1/0.45)
>   else:
>       return value / 4.5
>
>
>chris wrote:
>
>here is what i used in an old shake macro:
>>
>>CX_Lin_to_Rec709 = ColorX(Bytes3,
>>r <= 0.018 ? (r * 4.5) :  1.099 * pow( r, (0.45) ) - 0.099,
>>g <= 0.018 ? (g * 4.5) :  1.099 * pow( g, (0.45) ) - 0.099,
>>b <= 0.018 ? (b * 4.5) :  1.099 * pow( b, (0.45) ) - 0.099,
>>a, z);
>>
>>
>>can't remember where i got the formula from, but given the
>>reverse function matches yours there's a good chance that it
>>works ;)
>>
>>CX_Rec709_to_Lin2 = ColorX(SelectAlpha_In,
>>r <= 0.081 ? r / 4.5 : pow(( (r + 0.099)/1.099 ),  (1/0.45)),
>>g <= 0.081 ? g / 4.5 : pow(( (g + 0.099)/1.099 ),  (1/0.45)),
>>b <= 0.081 ? b / 4.5 : pow(( (b + 0.099)/1.099 ),  (1/0.45)),
>>a, z);
>>
>>
>>++ chris
>>
>>
>>
>>On 6/21/11 at 1:25 AM, tungau...@yahoo.com (Torax Unga) wrote:
>>
>>
>>Hello!
>>>What is the math formula to go from linear to rec709?
>>>basically inverting this: x<.081 ? x/4.5 : pow((x+.099)/1.099, 1/.45)
>>>
>>>Thanks in advance!
>>>
>>>T
>>>
>>_______________________________________________
>>Nuke-users mailing list
>>Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>
>-- 
>ben dickson
>2D TD | ben.dick...@rsp.com.au
>rising sun pictures | www.rsp.com.au
>
>_______________________________________________
>Nuke-users mailing list
>Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>

_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to