multicolorfits.combine_colorized_layers#

multicolorfits.combine_colorized_layers(colorized, mode='rgb', blend='screen', gamma=2.2, background='black', inverse=False, dtype=<class 'numpy.float64'>)[source]#

Combine a list of already-colorized RGB layers into a final image, applying a compositing mode / blend / gamma / inverse / background.

Single source of truth for the compositing math, shared by the session’s render_combined (real data) and combo_swatch (synthetic circles), so the legend’s overlap colors always match the displayed image.

Parameters:
  • colorized (list of arrays) – Colorized RGB layers (as from colorize_image).

  • mode (str) – ‘rgb’ (additive), ‘ryb’ (subtractive paint), ‘cmyk’ (print ink), or ‘lab’/’hsv’/’hsl’.

  • blend (str) – Lightness blend for the lab/hsv/hsl modes (‘screen’/’sum’/’max’/’mean’).

  • gamma (float)

  • background (color or None or 'black') – ‘black’ => classic additive (no flatten); any other color composites the result over it; None (or ‘transparent’/’none’) => transparent RGBA output.

  • inverse (bool) – Legacy complementary-color inverse (ignored when a non-black background is used).

  • dtype (numpy dtype)

Returns:

array – Combined RGB […,3] (or RGBA […,4] for a transparent background).