Replace specific image color in iOS

I want to replace a specific image color with another user-selected color. When replacing the image color, I want to keep the gradient effect of this original color. for example, see attached images. image1.png
image2.png

I tried to do this with CoreGraphics, and I managed to replace the color. But the replacement color does not support the gradient effect of the original color in the image.

Can someone help me? Is CoreGraphics the right way to do this? Thanks in advance.

+5
source share
2 answers

I do a lot of color rendering / blending / swapping / swapping between images in my projects and found the following publications very useful, like Eric Reinhard:

, - ( ) , , . , ( ) , !

EDIT:

, (, ). Photoshop magic wand tool, , , ( - ).

0

( NSImage), NSImage, ColorCube CIFilter.

https://github.com/braginets/NSImage-replace-color

UIImage ( CIColorCube): https://github.com/vhbit/ColorCubeSample

-1

All Articles