BrushCue Example: Shadow Tint¶
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")
dictionary_create_8 = brushcue.dictionary_create()
string_constant_9 = brushcue.string_constant("shadow_threshold")
float_constant_10 = brushcue.float_constant(0.3499999940395355)
float_constant_11 = brushcue.float_constant(-1.4901161193847656e-8)
float_constant_12 = brushcue.float_constant(-1.4901161193847656e-8)
shadow_threshold_13 = brushcue.float_passthrough(float_constant_10)
vector_2_float_from_components_14 = brushcue.vector2f_from_components(float_constant_11, float_constant_12)
float_add_to_dictionary_15 = brushcue.float_add_to_dictionary(dictionary_create_8, string_constant_9, shadow_threshold_13)
chroma_offset_16 = brushcue.vector2f_passthrough(vector_2_float_from_components_14)
vector_2_float_add_to_dictionary_17 = brushcue.vector2f_add_to_dictionary(float_add_to_dictionary_15, string_constant_7, chroma_offset_16)
composition_custom_transformer_shader_18 = 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_17, bool_constant_6)
ctx = brushcue.Context()
result = composition_custom_transformer_shader_18.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]: