#NEWLINE# def C_linear( C_srgb ) : #NEWLINE# #INDENT# out = np . empty ( C_srgb . shape , dtype = float ) #NEWLINE# linear_portion = ( C_srgb < 0.04045 ) #NEWLINE# a = 0.055 #NEWLINE# out [ linear_portion ] = ( C_srgb [ linear_portion ] / 12.92 ) #NEWLINE# out [ ( ~ linear_portion ) ] = ( ( ( C_srgb [ ( ~ linear_portion ) ] + a ) / ( a + 1 ) ) ** 2.4 ) #NEWLINE# return out