matplotlib 3.5.1

ParametersReturnsBackRef
blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None, hsv_min_val=None, hsv_min_sat=None)

The color of the resulting image will be darkened by moving the (s, v) values (in hsv colorspace) toward (hsv_min_sat, hsv_min_val) in the shaded regions, or lightened by sliding (s, v) toward (hsv_max_sat, hsv_max_val) in regions that are illuminated. The default extremes are chose so that completely shaded points are nearly black (s = 1, v = 0) and completely illuminated points are nearly white (s = 0, v = 1).

Parameters

rgb : ndarray

An MxNx3 RGB array of floats ranging from 0 to 1 (color image).

intensity : ndarray

An MxNx1 array of floats ranging from 0 to 1 (grayscale image).

hsv_max_sat : number, default: 1

The maximum saturation value that the intensity map can shift the output image to.

hsv_min_sat : number, optional

The minimum saturation value that the intensity map can shift the output image to. Defaults to 0.

hsv_max_val : number, optional

The maximum value ("v" in "hsv") that the intensity map can shift the output image to. Defaults to 1.

hsv_min_val : number, optional

The minimum value ("v" in "hsv") that the intensity map can shift the output image to. Defaults to 0.

Returns

ndarray

An MxNx3 RGB array representing the combined images.

Take the input data array, convert to HSV values in the given colormap, then adjust those color values to give the impression of a shaded relief map with a specified light source. RGBA values are returned, which can then be used to plot the shaded image with imshow.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.colors.LightSource.__init__

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/colors.py#2293
type: <class 'function'>
Commit: