
A UIImage category for getting pixel byte data into an NSData object, sampling pixel colour data at a point, sampling an even selection of pixels from a range (for using gradients swatches as colour profiles). Many thanks to the help in this SO questions.
Keeping this one in the back of your mind might save you some serious headache…