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.