Gimp.Drawable.prototype.histogram

function histogram(channel: Gimp.HistogramChannel, start_range: Number(gdouble), end_range: Number(gdouble)): [ok: Boolean, mean: Number(gdouble), std_dev: Number(gdouble), median: Number(gdouble), pixels: Number(gdouble), count: Number(gdouble), percentile: Number(gdouble)] {
    // Gjs wrapper for gimp_drawable_histogram()
}
  

Returns information on the intensity histogram for the specified drawable.

This tool makes it possible to gather information about the intensity histogram of a drawable. A channel to examine is first specified. This can be either value, red, green, or blue, depending on whether the drawable is of type color or grayscale. Second, a range of intensities are specified. The Gimp.Drawable.prototype.histogram function returns statistics based on the pixels in the drawable that fall under this range of values. Mean, standard deviation, median, number of pixels, and percentile are all returned. Additionally, the total count of pixels in the image is returned. Counts of pixels are weighted by any associated alpha values and by the current selection mask. That is, pixels that lie outside an active selection mask will not be counted. Similarly, pixels with transparent alpha values will not be counted. The returned mean, std_dev and median are in the range (0..255) for 8-bit images or if the plug-in is not precision-aware, and in the range (0.0..1.0) otherwise.

Since 2.10

channel

The channel to query.

start_range

Start of the intensity measurement range.

end_range

End of the intensity measurement range.

ok

TRUE on success.

mean

Mean intensity value.

std_dev

Standard deviation of intensity values.

median

Median intensity value.

pixels

Alpha-weighted pixel count for entire image.

count

Alpha-weighted pixel count for range.

percentile

Percentile that range falls under.