darsia.get_mean_color#

get_mean_color(image, mask=None)[source]#

Calculate the mean color of an image, optionally masked by a boolean mask.

Parameters:
imagedarsia.Image

The image from which to calculate the mean color.

maskdarsia.Image | np.ndarray | None

Optional mask to apply on the image. If None, the entire image is used.

Returns:
np.ndarray

The mean color of the image, calculated as the average of RGB values.