Color¶
Clamp¶
clamp the source image’s pixel values between given min and max limit.
>>> from image_utils.nodes import image
>>> from image_utils.nodes import color
>>> source_image = image.Read("source.exr")
>>> clamped_image = color.clamp(source_image, 0.1, 1.0)
>>> clamped_image.write("result.exr")
| type input_image: | |
|---|---|
| Read | |
| param input_image: | |
| input image to be clamped | |
| type min_value: | float |
| param min_value: | |
| minimum pixel value | |
| type max_value: | float |
| param max_value: | |
| maximum pixel value | |
| type clamp_alpha: | |
| bool | |
| param clamp_alpha: | |
| weather or not to clamp the alpha channel as well | |
| rtype: | Read |
| return: | result of the clamped image |
Set Color Look¶
apply an OpenColorIo “look” transform to the pixels
| type input_image: | |
|---|---|
| param input_image: | |
| type look: | |
| param look: | |
| rtype: | |
| return: | |
Set Color Display¶
apply an OpenColorIo “display” transform to the pixels
| type input_image: | |
|---|---|
| param input_image: | |
| type display: | |
| param display: | |
| return: | |
Gamma¶
apply gamma change to the source image.
>>> from image_utils.nodes import image
>>> from image_utils.nodes import color
>>> source_image = image.Read("source.tif")
>>> color.gamma(source_image, 0.45)
>>> source_image.write("result.png")
| Source | Applied Gamma |
|---|---|
|
|
| type input_image: | |
|---|---|
| Read | |
| param input_image: | |
| input image to be gamma corrected | |
| type gamma_r: | float |
| param gamma_r: | gamma value for red channel, or all channel. |
| type gamma_g: | float |
| param gamma_g: | gamma value for green channel (optional) |
| type gamma_b: | float |
| param gamma_b: | gamma value for blue channel (optional) |
| type gamma_a: | float |
| param gamma_a: | gamma value for alpha channel, default is 1 (optional) |
| rtype: | Read |
| return: | gamma corrected image |