# The PIL.ImageStat Module

The ImageStat module calculates global statistics for an image, or a region of an image.

## Module Contents

Stat(image, mask=None) (class) [#]

  Calculate statistics for the given image.

  For more information about this class, see The Stat Class.

## The Stat Class

Stat(image, mask=None) (class) [#]

  Calculate statistics for the given image. If a mask is included, only the regions covered by that mask are included in the statistics.

__init__(image, mask=None) [#]

  Create a statistics object.

  image
    A PIL image, or a precalculate histogram.
  mask
    An optional mask.