The Shape of Everything
A website mostly about Mac stuff, written by Gus Mueller
» Acorn
» Twitter
» Maybe Pizza?
» Code
» Archive
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?

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

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