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
Screenshot - https://github.com/kNeerajPro/ImagePixelFun/blob/master/Screenshots/screenshot.png