README.md
Overview
Count pixel values and output RGBA + L (luminance) histograms with customizable (0-256) number of bins.
Usage
Input
Parameter | Description |
---|---|
input_file | Data URI for a PNG image |
bins | (Optional) Number of histogram bins for each color channel. Clamped from [1-256], default is 256 |
Output
Parameter | Description |
---|---|
height | Pixel height of the input image |
width | Pixel width of the input image |
histograms | Contains four arrays with keys r (red), g (green), b (blue), a (alpha), l (luminance). Arrays are the length of the bins input parameter (default 256) |
Example
Input:
{
"input_file":"data://jhurliman/jhurliman/4a.png",
"bins":8
}
Output:
{
"height": 412,
"width": 438,
"histograms": {
"l": [0, 270, 1562, 844, 909, 1498, 48884, 126489],
"r": [0, 270, 60, 1820, 1076, 12912, 23989, 140329],
"g": [0, 1119, 969, 859, 805, 1239, 42939, 132526],
"b": [0, 1331, 775, 1050, 6687, 14720, 56867, 99026],
"a": [0, 0, 0, 0, 0, 0, 0, 180456]
}
}
Contents