1

I am having a image view in my view controller, i want to remove a color from whole image.

Does anyone knows how to remove a color from whole image?

See the below images. Red color is removed from whole image.

enter image description here

enter image description here

chetan panchal
  • 181
  • 2
  • 11
  • Do you wish to turn all pixels of exactly the picked RGB value into white? Or are you trying to do something more subtle and remove all red hue from every pixel value? (I think you're after the former but not sure.) – Ben Zotto Mar 08 '17 at 23:09
  • I want to turn all pixels into clear color not to remove red hue from whole image. Image i have uploaded is sample, image could be any. @BenZotto – chetan panchal Mar 08 '17 at 23:13
  • Then you can create a new bitmap context, draw the image into it, and then loop through each pixel. If it matches your target color, change it to transparent. Then create a new UIImage from this context. – Ben Zotto Mar 08 '17 at 23:17
  • i have already done this thing, but only some pixels are being removed from image, i have tried using different images as well. – chetan panchal Mar 08 '17 at 23:19

0 Answers0