BrushCue Example: High Contrast Grayscale¶

Open In Colab

You can use this tool online at https://www.brushcue.com/tools/high-contrast-grayscale

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
composition_grayscale_2 = brushcue.composition_grayscale(input_image_1)
float_constant_3 = brushcue.float_constant(0.5)
float_constant_4 = brushcue.float_constant(1.0)
float_constant_5 = brushcue.float_constant(1.0)
float_constant_6 = brushcue.float_constant(1.0)
float_constant_7 = brushcue.float_constant(1.0)
factor_8 = brushcue.float_passthrough(float_constant_7)
float_add_9 = brushcue.float_add(factor_8, float_constant_6)
curve_s_10 = brushcue.curve_s_curve(float_constant_3, float_add_9, float_constant_4, float_constant_5)
composition_lightness_curve_11 = brushcue.composition_l_curve(composition_grayscale_2, curve_s_10)

ctx = brushcue.Context()
result = composition_lightness_curve_11.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