A small UIImage extension to play with pixels of an image. Helper methods to - Set/Get colors of a pixel. Create a grayscale image. Change color of an array of pixels conditionally by providing closure.
Here is the accompanying blog - https://medium.com/hacking-ios/uiimage-pixel-play-extension-in-swift-7c6fe90396b6