Wrote functions to calculate percentage of pixels above or below value.