BrushCue Example: Duotone Effect¶

Open In Colab

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

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

import brushcue as bc

shadow_rgba = bc.RGBAColor.from_components(0.09, 0.23, 0.06, 1.0)
shadow_color = bc.ProfiledColor.from_rgba_srgb(shadow_rgba)
highlight_rgba = bc.RGBAColor.from_components(0.87, 0.87, 0.49, 1.0)
highlight_color = bc.ProfiledColor.from_rgba_srgb(highlight_rgba)
graph = bc.Composition.monet_women_with_parasol().duotone(
    0.5, shadow_color, highlight_color
)

ctx = bc.Context()
composition = graph.execute(ctx)
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
[wgpu] using backend Metal — adapter 'Apple M5' (IntegratedGpu), driver ''
Out[1]:
No description has been provided for this image