August 21, 2011
I've always been a bit annoyed with Core Image's CIAreaHistogram filter, because how it works exactly is a bit of a mystery to me.
For instance- what exactly is that single opaque pixel that you get from CIAreaHistogram? All your buddies have their alpha set to zero- but not you! You're visible!
![What are you little pixel?](http://gusmueller.com/2011/images/acorn/d9c22dd9-3281-43ce-9910-d428ca48032d.png)
And what exactly do I have to do to make my peaks reach a certain height? Do I just play with inputScale and cross my fingers?
![Mr. Histogram](http://gusmueller.com/2011/images/acorn/e573af71-7d6f-4b7e-802f-b5405b08bf2f.png)
So today I put together a little cikernel in JSTalk which will produce the above image. If you'd like to play with CIAreaHistogram (as I did) or if you'd like to do something similar in your Cocoa app, you can grab the source for this script: histogram.jstalk