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.
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.
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, , , ( - ).
( NSImage), NSImage, ColorCube CIFilter.
https://github.com/braginets/NSImage-replace-color
UIImage ( CIColorCube): https://github.com/vhbit/ColorCubeSample