.. Automatically generated file - do not modify.

.. function:: im.MatrixColor(im, matrix, **properties)
    
    An image operator that uses `matrix` to linearly transform the
    image manipulator `im`.
    
    `Matrix` should be a list, tuple, or :func:`im.matrix` that is 20
    or 25 elements long. If the object has 25 elements, then elements
    past the 20th are ignored.
    
    When the four components of the source color are R, G, B, and A,
    which range from 0.0 to 1.0; the four components of the transformed
    color are R', G', B', and A', with the same range; and the elements
    of the matrix are named::
    
        [ a, b, c, d, e,
          f, g, h, i, j,
          k, l, m, n, o,
          p, q, r, s, t ]
    
    the transformed colors can be computed with the formula::
    
        R' = (a * R) + (b * G) + (c * B) + (d * A) + e
        G' = (f * R) + (g * G) + (h * B) + (i * A) + j
        B' = (k * R) + (l * G) + (m * B) + (n * A) + o
        A' = (p * R) + (q * G) + (r * B) + (s * A) + t
    
    The components of the transformed color are clamped to the
    range [0.0, 1.0].

.. function:: im.matrix()
    
    Constructs an im.matrix object from `matrix`. im.matrix objects
    support The operations supported are matrix multiplication, scalar
    multiplication, element-wise addition, and element-wise
    subtraction. These operations are invoked using the standard
    mathematical operators (\*, \*, +, and -, respectively). If two
    im.matrix objects are multiplied, matrix multiplication is
    performed, otherwise scalar multiplication is used.
    
    `matrix` is a 20 or 25 element list or tuple. If it is 20 elements
    long, it is padded with (0, 0, 0, 0, 1) to make a 5x5 matrix,
    suitable for multiplication.

.. function:: im.matrix.brightness(b)
    
    Returns an im.matrix that alters the brightness of an image.
    
    `b`
        The amount of change in image brightness. This should be
        a number between -1 and 1, with -1 the darkest possible
        image and 1 the brightest.

.. function:: im.matrix.colorize(black_color, white_color)
    
    Returns an im.matrix that colorizes a black and white image.
    `black_color` and `white_color` are Ren'Py style colors, so
    they may be specified as strings or tuples of (0-255) color
    values. ::
    
        # This makes black colors red, and white colors blue.
        image logo colored = im.MatrixColor(
            "bwlogo.png",
            im.matrix.colorize("#f00", "#00f"))

.. function:: im.matrix.contrast(c)
    
    Returns an im.matrix that alters the contrast of an image. `c` should
    be greater than 0.0, with values between 0.0 and 1.0 decreasing contrast, and
    values greater than 1.0 increasing contrast.

.. function:: im.matrix.desaturate()
    
    Returns an im.matrix that desaturates the image (makes it
    grayscale). This is equivalent to calling
    im.matrix.saturation(0).

.. function:: im.matrix.hue(h)
    
    Returns an im.matrix that rotates the hue by `h` degrees, while
    preserving luminosity.

.. function:: im.matrix.identity()
    
    Returns an identity matrix, one that does not change color or
    alpha.

.. function:: im.matrix.invert()
    
    Returns an im.matrix that inverts the red, green, and blue
    channels of the image without changing the alpha channel.

.. function:: im.matrix.opacity(o)
    
    Returns an im.matrix that alters the opacity of an image. An
    `o` of 0.0 is fully transparent, while 1.0 is fully opaque.

.. function:: im.matrix.saturation(level, desat=(0.2126, 0.7152, 0.0722))
    
    Returns an im.matrix that alters the saturation of an
    image. The alpha channel is untouched.
    
    `level`
        The amount of saturation in the resulting image. 1.0 is
        the unaltered image, while 0.0 is grayscale.
    
    `desat`
        This is a 3-element tuple that controls how much of the
        red, green, and blue channels will be placed into all
        three channels of a fully desaturated image. The default
        is based on the constants used for the luminance channel
        of an NTSC television signal. Since the human eye is
        mostly sensitive to green, more of the green channel is
        kept then the other two channels.

.. function:: im.matrix.tint(r, g, b)
    
    Returns an im.matrix that tints an image, without changing
    the alpha channel. `r`, `g`, and `b` should be numbers between
    0 and 1, and control what fraction of the given channel is
    placed into the final image. (For example, if `r` is .5, and
    the value of the red channel is 100, the transformed color
    will have a red value of 50.)

