PNG Image Histogram

Create RGBA histogram data arrays from a PNG image

MIT License

Try the API

{
  "height": 412,
  "histograms": {
    "a": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      180456
    ],
    "b": [
      0,
      1331,
      775,
      1050,
      6687,
      14720,
      56867,
      99026
    ],
    "g": [
      0,
      1119,
      969,
      859,
      805,
      1239,
      42939,
      132526
    ],
    "l": [
      0,
      270,
      1562,
      844,
      909,
      1498,
      48884,
      126489
    ],
    "r": [
      0,
      270,
      60,
      1820,
      1076,
      12912,
      23989,
      140329
    ]
  },
  "width": 438
}

Install & Use

Use

curl -X POST -d '{
  "input_file":"data://jhurliman/jhurliman/4a.png",
  "bins":8
}' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/jhurliman/PNGImageHistogram/0.1.2