From 4b9ab547d73a75075e528b4c614110f6fc379c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Mon, 8 Feb 2016 09:43:11 +0100 Subject: [PATCH] update nuke-default --- nuke-default/config.ocio | 1 - nuke-default/luts/alexalogc.spi1d | 0 nuke-default/luts/cineon.spi1d | 0 nuke-default/luts/panalog.spi1d | 0 nuke-default/luts/ploglin.spi1d | 0 nuke-default/luts/rec709.spi1d | 0 nuke-default/luts/redlog.spi1d | 0 nuke-default/luts/slog.spi1d | 0 nuke-default/luts/srgb.spi1d | 0 nuke-default/luts/srgbf.spi1d | 0 nuke-default/luts/viperlog.spi1d | 0 nuke-default/make.py | 242 ++++++++++++++++++++++++++---- 12 files changed, 211 insertions(+), 32 deletions(-) mode change 100644 => 100755 nuke-default/config.ocio mode change 100644 => 100755 nuke-default/luts/alexalogc.spi1d mode change 100644 => 100755 nuke-default/luts/cineon.spi1d mode change 100644 => 100755 nuke-default/luts/panalog.spi1d mode change 100644 => 100755 nuke-default/luts/ploglin.spi1d mode change 100644 => 100755 nuke-default/luts/rec709.spi1d mode change 100644 => 100755 nuke-default/luts/redlog.spi1d mode change 100644 => 100755 nuke-default/luts/slog.spi1d mode change 100644 => 100755 nuke-default/luts/srgb.spi1d mode change 100644 => 100755 nuke-default/luts/srgbf.spi1d mode change 100644 => 100755 nuke-default/luts/viperlog.spi1d diff --git a/nuke-default/config.ocio b/nuke-default/config.ocio old mode 100644 new mode 100755 index bdb5caec..1e38da1a --- a/nuke-default/config.ocio +++ b/nuke-default/config.ocio @@ -14,7 +14,6 @@ roles: reference: linear scene_linear: linear texture_paint: sRGB - viewer: sRGB displays: default: diff --git a/nuke-default/luts/alexalogc.spi1d b/nuke-default/luts/alexalogc.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/cineon.spi1d b/nuke-default/luts/cineon.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/panalog.spi1d b/nuke-default/luts/panalog.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/ploglin.spi1d b/nuke-default/luts/ploglin.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/rec709.spi1d b/nuke-default/luts/rec709.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/redlog.spi1d b/nuke-default/luts/redlog.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/slog.spi1d b/nuke-default/luts/slog.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/srgb.spi1d b/nuke-default/luts/srgb.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/srgbf.spi1d b/nuke-default/luts/srgbf.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/luts/viperlog.spi1d b/nuke-default/luts/viperlog.spi1d old mode 100644 new mode 100755 diff --git a/nuke-default/make.py b/nuke-default/make.py index de115648..bb939a99 100755 --- a/nuke-default/make.py +++ b/nuke-default/make.py @@ -95,27 +95,27 @@ def fromSRGB(v): cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) - -NUM_SAMPLES = 2**16+25 -RANGE = (-0.125, 4.875) -data = [] -for i in xrange(NUM_SAMPLES): - x = i/(NUM_SAMPLES-1.0) - x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) - data.append(fromSRGB(x)) - -# Data is srgb->linear -WriteSPI1D('luts/srgbf.spi1d', RANGE[0], RANGE[1], data) - -cs = OCIO.ColorSpace(name='sRGBf') -cs.setDescription("Standard RGB Display Space, but with additional range to preserve float highlights.") -cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) -cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) -cs.setAllocationVars([RANGE[0], RANGE[1]]) - -t = OCIO.FileTransform('srgbf.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) -cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) -config.addColorSpace(cs) +#Disabled pending matching root lut with extra range & name in Nuke. +#NUM_SAMPLES = 2**16+25 +#RANGE = (-0.125, 4.875) +#data = [] +#for i in xrange(NUM_SAMPLES): +# x = i/(NUM_SAMPLES-1.0) +# x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) +# data.append(fromSRGB(x)) +# +## Data is srgb->linear +#WriteSPI1D('luts/srgbf.spi1d', RANGE[0], RANGE[1], data) +# +#cs = OCIO.ColorSpace(name='sRGBf') +#cs.setDescription("Standard RGB Display Space, but with additional range to preserve float highlights.") +#cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +#cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +#cs.setAllocationVars([RANGE[0], RANGE[1]]) +# +#t = OCIO.FileTransform('srgbf.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +#cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +#config.addColorSpace(cs) ############################################################################### @@ -189,11 +189,10 @@ def fromCineon(x): config.addColorSpace(cs) - ############################################################################### cs = OCIO.ColorSpace(name='Gamma1.8') -cs.setDescription("Emulates a idealized Gamma 1.8 display device.") +cs.setDescription("Emulates an idealized Gamma 1.8 display device.") cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) cs.setAllocationVars([0.0, 1.0]) @@ -203,7 +202,7 @@ def fromCineon(x): config.addColorSpace(cs) cs = OCIO.ColorSpace(name='Gamma2.2') -cs.setDescription("Emulates a idealized Gamma 2.2 display device.") +cs.setDescription("Emulates an idealized Gamma 2.2 display device.") cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) cs.setAllocationVars([0.0, 1.0]) @@ -212,10 +211,19 @@ def fromCineon(x): cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) config.addColorSpace(cs) +cs = OCIO.ColorSpace(name='Gamma2.4') +cs.setDescription("Emulates an idealized Gamma 2.4 display device.") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([0.0, 1.0]) -############################################################################### +t = OCIO.ExponentTransform(value=(2.4,2.4,2.4,1.0)) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) +############################################################################### + # Log to Linear light conversions for Panalog # WARNING: these are estimations known to be close enough. # The actual transfer functions are not published @@ -251,11 +259,8 @@ def fromPanalog(x): config.addColorSpace(cs) - ############################################################################### - - redBlackOffset = 10.0 ** ((0.0 - 1023.0) / 511.0) def fromREDLog(x): @@ -288,7 +293,6 @@ def fromREDLog(x): config.addColorSpace(cs) - ############################################################################### def fromViperLog(x): @@ -321,10 +325,8 @@ def fromViperLog(x): config.addColorSpace(cs) - ############################################################################### - alexav3logc_a = 5.555556 alexav3logc_b = 0.052272 alexav3logc_c = 0.247190 @@ -416,6 +418,11 @@ def fromPLogLin(x): ############################################################################### +'SLog' + +#Note this is an old version that doesn't take black offsets into account. +#SLog1 should be used instead, this is here for back compat. + def fromSLog(x): return (10.0 ** (((x - 0.616596 - 0.03) / 0.432699)) - 0.037584) @@ -445,6 +452,178 @@ def fromSLog(x): config.addColorSpace(cs) +############################################################################### + +'SLog1' + +#The original SLog is actually incorrect (see note above), this should be used +#in its place. + +def fromSLog1(x): + return (((10.0 ** (((((x*1023.0)/4.0-16.0)/219.0)-0.616596-0.03)/0.432699))-0.037584)*0.9) + +# These samples and range have been chosen to write out this colorspace with +# a limited over/undershoot range, which also exactly samples the 0.0,1.0 +# crossings + +NUM_SAMPLES = 2**12+5 +RANGE = (-0.125, 1.125) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(fromSLog(x)) + +# Data is srgb->linear +WriteSPI1D('luts/slog1.spi1d', RANGE[0], RANGE[1], data) + +cs = OCIO.ColorSpace(name='SLog1') +cs.setDescription("Sony SLog1") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([RANGE[0], RANGE[1]]) + +t = OCIO.FileTransform('slog1.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + +############################################################################### + +'SLog2' + +def fromSLog2(x): + if x >= 0.030001222851889303: + return ((219.0*((10.0 ** ((x-0.616596-0.04)/0.432699))-0.037584)/155.0)*0.9) + return ((x-0.030001222851889303)*0.28258064516129*0.9) + +# These samples and range have been chosen to write out this colorspace with +# a limited over/undershoot range, which also exactly samples the 0.0,1.0 +# crossings + +NUM_SAMPLES = 2**12+5 +RANGE = (-0.125, 1.125) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(fromSLog2(x)) + +# Data is srgb->linear +WriteSPI1D('luts/slog2.spi1d', RANGE[0], RANGE[1], data) + +cs = OCIO.ColorSpace(name='SLog2') +cs.setDescription("Sony SLog2") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([RANGE[0], RANGE[1]]) + +t = OCIO.FileTransform('slog2.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + +############################################################################### + +'SLog3' + +def fromSLog3(x): + if x >= 171.2102946929/1023.0: + return (((10.0 ** ((x*1023.0-420.0)/261.5))*(0.18+0.01))-0.01) + return ((x*1023.0-95.0)*0.01125/(171.2102946929-95.0)) + +# These samples and range have been chosen to write out this colorspace with +# a limited over/undershoot range, which also exactly samples the 0.0,1.0 +# crossings + +NUM_SAMPLES = 2**12+5 +RANGE = (-0.125, 1.125) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(fromSLog3(x)) + +# Data is srgb->linear +WriteSPI1D('luts/slog3.spi1d', RANGE[0], RANGE[1], data) + +cs = OCIO.ColorSpace(name='SLog3') +cs.setDescription("Sony SLog3") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([RANGE[0], RANGE[1]]) + +t = OCIO.FileTransform('slog3.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + +############################################################################### + +'CLog' + +def fromCLog(x): + return (((10.0 ** (x - 0.0730597)/0.529136) - 1.0)/10.1596) + +# These samples and range have been chosen to write out this colorspace with +# a limited over/undershoot range, which also exactly samples the 0.0,1.0 +# crossings + +NUM_SAMPLES = 2**12+5 +RANGE = (-0.0684932, 1.08676) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(fromCLog(x)) + +# Data is srgb->linear +WriteSPI1D('luts/clog.spi1d', RANGE[0], RANGE[1], data) + +cs = OCIO.ColorSpace(name='CLog') +cs.setDescription("Canon CLog") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([RANGE[0], RANGE[1]]) + +t = OCIO.FileTransform('clog.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + +############################################################################### + +'Protune' + +def fromProtune(x): + return (((113.0 ** x) - 1.0)/(112.0)) + +# These samples and range have been chosen to write out this colorspace with +# a limited over/undershoot range, which also exactly samples the 0.0,1.0 +# crossings + +NUM_SAMPLES = 2**12+5 +RANGE = (-0.125, 1.125) +data = [] +for i in xrange(NUM_SAMPLES): + x = i/(NUM_SAMPLES-1.0) + x = Fit(x, 0.0, 1.0, RANGE[0], RANGE[1]) + data.append(fromProtune(x)) + +# Data is srgb->linear +WriteSPI1D('luts/protune.spi1d', RANGE[0], RANGE[1], data) + +cs = OCIO.ColorSpace(name='Protune') +cs.setDescription("GoPro Protune") +cs.setBitDepth(OCIO.Constants.BIT_DEPTH_F32) +cs.setAllocation(OCIO.Constants.ALLOCATION_UNIFORM) +cs.setAllocationVars([RANGE[0], RANGE[1]]) + +t = OCIO.FileTransform('protune.spi1d', interpolation=OCIO.Constants.INTERP_LINEAR) +cs.setTransform(t, OCIO.Constants.COLORSPACE_DIR_TO_REFERENCE) +config.addColorSpace(cs) + + ############################################################################### 'REDSpace' @@ -466,6 +645,7 @@ def fromSLog(x): config.addDisplay(display, 'None', 'raw') config.addDisplay(display, 'sRGB', 'sRGB') config.addDisplay(display, 'rec709', 'rec709') +config.addDisplay(display, 'rec1886', 'Gamma2.4') config.setActiveDisplays('default') config.setActiveViews('sRGB')