Search code examples
iosswiftphotos

Getting the intensity of each colour in a captured image in iOS


In my app, I am capturing an image and want to get the intensity of each colour. Which way is the best way to proceed?


Solution

  • Have a read on this article about Pixel Manipulation in swift.

    https://medium.com/hacking-ios/uiimage-pixel-play-extension-in-swift-7c6fe90396b6

    Once you are done with it. A good strategy for collecting color data from an image is to loop through each of its pixels and store each pixel's color information in an array and then loop through them to derive the insight you want from that data.