BrushCue Example: Shadow Tint¶

Open In Colab

You can use this tool online at https://www.brushcue.com/tools/shadow-tint

In [ ]:
!pip install brushcue
In [1]:
import brushcue
from PIL import Image
import io

input_image_1 = brushcue.composition_monet_women_with_parasol() # insert your own image here
string_constant_2 = brushcue.string_constant("  var blend = smoothstep(shadow_threshold + 0.1, shadow_threshold - 0.1, input.r);\n  return vec4<f32>(input.r, input.g + (chroma_offset.x * blend), input.b + (chroma_offset.y * blend), input.a);")
string_constant_3 = brushcue.string_constant("// You can write your helper functions here if you need them.")
color_profile_oklaba_4 = brushcue.color_profile_ok_lab_a()
color_profile_oklaba_5 = brushcue.color_profile_ok_lab_a()
bool_constant_6 = brushcue.bool_constant(False)
string_constant_7 = brushcue.string_constant("chroma_offset")
vector_2_float_from_components_8 = brushcue.vector2f_from_components(-0.000000014901161, -0.000000014901161)
dictionary_create_9 = brushcue.dictionary_create()
string_constant_10 = brushcue.string_constant("shadow_threshold")
float_add_to_dictionary_11 = brushcue.float_add_to_dictionary(dictionary_create_9, string_constant_10, 0.35)
vector_2_float_add_to_dictionary_12 = brushcue.vector2f_add_to_dictionary(float_add_to_dictionary_11, string_constant_7, vector_2_float_from_components_8)
composition_custom_transformer_shader_13 = brushcue.composition_custom_transformer_shader(input_image_1, string_constant_2, string_constant_3, color_profile_oklaba_4, color_profile_oklaba_5, vector_2_float_add_to_dictionary_12, bool_constant_6)

ctx = brushcue.Context()
result = composition_custom_transformer_shader_13.execute(ctx)
composition = result.as_composition()
data_bytes = composition.to_image_bytes(ctx)
img = Image.open(io.BytesIO(data_bytes))
img.thumbnail((400, 400)) # remove this line for full resolution
img
Out[1]:
No description has been provided for this image