I have the following MonoTouch
code which can change the Saturation
, but I am trying to also change the Hue
.
float hue = 0;
float saturation = 1;
if (colorCtrls == null)
colorCtrls = new CIColorControls() {
Image = CIImage.FromCGImage (originalImage.CGImage) };
else
colorCtrls.Image = CIImage.FromCGImage(originalImage.CGImage);
colorCtrls.Saturation = saturation;
var output = colorCtrls.OutputImage;
var context = CIContext.FromOptions(null);
var result = context.CreateCGImage(output, output.Extent);
return UIImage.FromImage(result);
Here's what I ended up doing to add Hue:
However, this does not work on Retina devices, the image returned is scaled incorrectly.
It's part of a different filter so you'll need to use
CIHueAdjust
instead ofCIColorControls
to control the hue.