multicolorfits.colorize_image_direct_rgb#
- multicolorfits.colorize_image_direct_rgb(grey_rgb_image, hex_color, brightness_factor=1.0, gammacorr_color=1)[source]#
Tint a greyscale RGB cube by multiplying channels with a solid hex color.
Equivalent to the HSV path in
colorize_image()for greyscale inputs (hsv_to_rgb(h, s, V)is linear inV, so tinting reduces tointensity * (color_rgb ** gammacorr_color)), but avoids a full RGB↔HSV round-trip. Used automatically bycolorize_image()for hex colors.- Parameters:
grey_rgb_image (numpy.ndarray) – Greyscale RGB image (R = G = B), typically from
to_grey_rgb().hex_color (str) – Hex color such as
'#FF0000'.brightness_factor (float) – Multiplier on the tinted result (analogous to HSV value).
gammacorr_color (float) – Gamma applied to the color itself (matches
colorize_image). Use1for no color gamma.
- Returns:
numpy.ndarray – Colorized RGB image in [0, 1], same shape as the input.