更改面部颜色从xcode中的主要颜色

我在ios上工作,我需要工具或代码,只改变图像的面部颜色。

我已经在uiimage面前了。

现在如何将RGB颜色变换应用于该脸部的Uiimage?

提前致谢

在此处输入图像描述

你可以这样做,

UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(50, 50, 50, 50)]; imageView.image = [UIImage imageNamed:@"Synch"]; // your face image here imageView.image = [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; // imageView.backgroundColor = [UIColor yellowColor]; imageView.tintColor = [UIColor redColor]; // set different tint color here and image will get that color [self.view addSubview:imageView]; 

图像应该是png文件。 同步图像在示例中为png格式。

希望这会有所帮助:)

其中一个库可以实现您的目标,即改变图像的肤色。

YUCIHighPassSkinSmoothing

在这里取样。

在此处输入图像描述