File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ for a region of an image.
1414 statistics. You can also pass in a previously calculated histogram.
1515
1616 :param image: A PIL image, or a precalculated histogram.
17+
18+ .. note ::
19+
20+ For a PIL image, calculations rely on the
21+ :py:meth: `~PIL.Image.Image.histogram ` method. The pixel counts are
22+ grouped into 256 bins, even if the image has more than 8 bits per
23+ channel. So ``I `` and ``F `` mode images have a maximum ``mean ``,
24+ ``median `` and ``rms `` of 255, and cannot have an ``extrema `` maximum
25+ of more than 255.
26+
1727 :param mask: An optional mask.
1828
1929 .. py :attribute :: extrema
Original file line number Diff line number Diff line change @@ -1492,11 +1492,12 @@ def getprojection(self):
14921492
14931493 def histogram (self , mask = None , extrema = None ):
14941494 """
1495- Returns a histogram for the image. The histogram is returned as
1496- a list of pixel counts, one for each pixel value in the source
1497- image. If the image has more than one band, the histograms for
1498- all bands are concatenated (for example, the histogram for an
1499- "RGB" image contains 768 values).
1495+ Returns a histogram for the image. The histogram is returned as a
1496+ list of pixel counts, one for each pixel value in the source
1497+ image. Counts are grouped into 256 bins for each band, even if
1498+ the image has more than 8 bits per band. If the image has more
1499+ than one band, the histograms for all bands are concatenated (for
1500+ example, the histogram for an "RGB" image contains 768 values).
15001501
15011502 A bilevel image (mode "1") is treated as a greyscale ("L") image
15021503 by this method.
You can’t perform that action at this time.
0 commit comments