get_histogram
Statistics for several channels from ONE render: mean, median, 1st/5th/95th/99th percentiles and a 256-bin histogram per channel (bins[v] = pixel count at value v, 0-255, in the structured result); the text also gives each channel's pixel count at 0 and at 255, which tells real clipping from a value merely near the limit. Luminance uses perceptual weights. The default is fast (about 0.3 s, from a 1024 px proxy render): good for iterating, but small clipped highlights can be under-counted. Pass exact: true (about 4 s on 24 MP, much longer on a very large photo) as the final clipping check before export_photo; if it times out the editing session restarts and unsaved work is lost, so checkpoint first. region and mask narrow what is measured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | The name of a selection channel: measure only the pixels it selects at 50% or more (a hard cut, no partial credit for soft edges), e.g. the mean lightness or color of a selected object. Combines with region and exact; pixels in the result is the number of pixels counted. | |
| exact | No | false (default): computed on the 1024px proxy render (~0.3s) — good for iterating, but small clipped highlights can be under-counted. true: full-resolution composite (~4s on 24MP) — the trustworthy final clipping check before export. On a very large document true can take much longer; if it times out the editing session restarts and unsaved work is lost, so save (checkpoint) first. | |
| image | Yes | Image id, as returned by open_photo. | |
| region | No | A rectangle in document pixels: {x, y, width, height}. Must lie entirely within the image — a region partly or fully outside it is refused rather than silently clamped. Computed on the proxy when it maps to a big-enough proxy area, else auto-falls back to a full-resolution crop; exact:true always forces the full-resolution crop. | |
| channels | No | Default: all four (luminance, red, green, blue) in ONE render. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | ||
| width | No | ||
| height | No | ||
| pixels | No | ||
| channels | No | Keyed by channel name (luminance, red, green, blue). | |
| unmirrored_filters | No | Names of live filters that could not be re-attached on this proxy render — absent from these stats entirely. Present whenever histogram actually used the (mirrored) preview proxy: the default whole-image path, OR a `region` large enough to be sampled from the proxy rather than falling back to a full-resolution crop. Absent when exact: true, or when a region is too small and falls back to that full-resolution crop — neither path mirrors filters at all. |