MonoTouch.CoreImage Namespace

Accelerated image processing.


CoreImage provides a framework for processing still images and applying a set of operations on them to either produce new images or perform image analysis (like performing face detection and photography auto-enhance). The operations are hardware accelerated and provide better performance than most hand written implementations.

CoreImage can apply either one filter to an image or you can use the built-in chaining support to apply a series of filters at once to an image. For example, you could apply a Sepia Filter, followed by a Hue adjustment filter, followed by a contrast filter. The idea behind the chaining support is to avoid intermediate copies and intermediate buffers during image processing. Additionally, some of these filtering operations can be performed entirely on the GPU in a single pass, without having to copy data back and forth from the GPU to the main memory.

The CoreImage runtime sits below the MonoTouch.CoreGraphics, MonoTouch.CoreVideo and MonoTouch.ImageIO stacks and provides services to all of them. Depending on the filter operations and the hardware platform, CoreImage will execute the filters in the CPU or the GPU.

To use CoreImage on iOS, you follow these steps:

C# Example

	// This sample turns the image into a sepia image

	// Load the image using UIImage, it is convenient
	var uiimage = UIImage.FromFile ("sample.jpg");

	// Create the CIImage, using the UIImage's CGImage as a reference
	var image = new CIImage (uiimage.CGImage);

	// Create the filter
	var sepia = new CISepiaTone () {
		Image = image,
		Intensity = .8f

	// Generate the recipe.   It is important to note that at this point
	// the resulting CIImage merely contains the recipe on how to create
	// the image, this is important, because you can use this result as
	// the input to another filter to chain filters together and only 
	// at the last minute, when the CIContext rendering APIs are used,
	// does the actual pipeline execute.   This allows for a series of
	// operations to all be performed in one step without intermediate
	// buffer copies.
	CIImage output = sepia.OutputImage;

	// To render the results, we need to create a context, and then
	// use one of the context rendering APIs, in this case, we render the
	// result into a CoreGraphics image, which is merely a useful representation
	var context = CIContext.FromOptions (null);
	var cgimage = context.CreateCGImage (output, output.Extent);

	// The above cgimage can be added to a screen view, for example, this
	// would add it to a UIImageView on the screen:
	myImageView.Image = UIImage.FromImage (cgimage);

Face detection is done with the MonoTouch.CoreImage.CIDetector class by calling the MonoTouch.CoreImage.CIDetector.CreateFaceDetector(MonoTouch.CoreImage.CIContext, bool) method which returns an array of MonoTouch.CoreImage.CIFeature objects with any detected face features found.

Auto-adjustments are implemented by calling the MonoTouch.CoreImage.GetAutoAdjustmentFilters() method. This method returns a list of suggested CIFilter which you in turn would apply to your image and render to a context.

To chain filters, all you have to do is connect the OutputImage property from a filter to the Image property of another filter. This is a modified version of the previous example showing how to chain two filters together:

C# Example

	var uiimage = UIImage.FromFile ("sample.jpg");
	var image = new CIImage (uiimage.CGImage);

	var sepia = new CISepiaTone () {
		Image = image,
		Intensity = .8f
	// Chain the Sepia filter to a Color inversion filter, this is done
	// by assigning the CIColorInvert.Input to the sepia.OutputImage
	var invert = new CIColorInvert () {
		Image = sepia.OutputImage;

	CIImage output = invert.OutputImage;
	var context = CIContext.FromOptions (null);
	var cgimage = context.CreateCGImage (output, output.Extent);

	myImageView.Image = UIImage.FromImage (cgimage);


CIAccordionFoldTransitionAnimates a transition by creating an accordion-fold effect on the source image.
CIAdditionCompositingThe CIAdditionCompositing CoreImage filter.
CIAffineClampA MonoTouch.CoreImage.CIAffineFilter that extends the border pixels to the post-transform boundaries.
CIAffineFilterAn abstract class that defines a MonoTouch.CoreImage.CIFilter that performs an affine transform on an image and then performs a filtering operation on the transformed image.
CIAffineTileA MonoTouch.CoreImage.CIAffineFilter that tiles the transformed image.
CIAffineTransformPerforms an affine transform on an image.
CIAreaHistogramCreates histogram data for a given image and rectangle of interest.
CIAutoAdjustmentFilterOptionsWhen passed to MonoTouch.CoreImage.CIImage.GetAutoAdjustmentFilters, limits the results.
CIAztecCodeGeneratorGenerates an Aztec code for the specified MonoTouch.CoreImage.CIAztecCodeGenerator.Message.
CIBarsSwipeTransitionA MonoTouch.CoreImage.CITransitionFilter that animates a transition by moving a bar over the source image.
CIBlendFilterAn abstract MonoTouch.CoreImage.CIFilter that combines a background and foreground image.
CIBlendWithAlphaMaskA MonoTouch.CoreImage.CIBlendWithMask that uses a mask image to blend foreground and background images.
CIBlendWithMaskA MonoTouch.CoreImage.CIBlendFilter that uses a grayscale mask to blends its foreground and background images.
CIBloomA MonoTouch.CoreImage.CIFilter that creates an edge-flow effect.
CIBumpDistortionA MonoTouch.CoreImage.CIDistortionFilter that creates a bump at the specified center point.
CIBumpDistortionLinearA filter that distorts the image around a convex or concave line.
CICheckerboardGeneratorThe CICheckerboardGenerator CoreImage filter
CICircleSplashDistortionMakes the pixels at the circumference of a circle spread out to the boundaries of the image.
CICircularScreenA MonoTouch.CoreImage.CIScreenFilter that creates a circular bulls-eye-style halftone screen.
CICode128BarcodeGeneratorGenerates a Code 128 barcode.
CIColorA Core Image color, including both color values and a reference to a color space.
CIColorBlendModeThe CIColorBlendMode CoreImage filter
CIColorBurnBlendModeThe CIColorBurnBlendMode CoreImage filter
CIColorClampA filter that constrains the color values between the range specified.
CIColorControlsThe CIColorControls CoreImage filter
CIColorCrossPolynomialA filter that modifies the source pixels by applying a set of polynomial cross-products.
CIColorCubeThe CIColorCube CoreImage filter
CIColorCubeWithColorSpaceA filter that modifies the source pixels using a 3D color-table and then maps the result to a color space.
CIColorDodgeBlendModeThe CIColorDodgeBlendMode CoreImage filter
CIColorInvertThe CIColorInvert CoreImage filter
CIColorKernelKernel for a GPU process that only operates on color data.
CIColorMapChanges colors based on an input gradient image's mapping.
CIColorMatrixThe CIColorMatrix CoreImage filter.
CIColorMonochromeThe CIColorMonochrome CoreImage filter
CIColorPolynomialA filter that modifies the source pixels by applying a set of cubic polynomials.
CIColorPosterizeReduces the number of levels for each color component.
CICompositingFilterAn abstract MonoTouch.CoreImage.CIFilter that composites two images.
CIConstantColorGeneratorThe CIConstantColorGenerator CoreImage filter
CIContextOrchestrates the rendering of a CIFilter pipeline.
CIContextOptionsUse to configure the CIContext rendering pipeline.
CIConvolution3X3A filter that performs a custom 3x3 matrix convolution.
CIConvolution5X5A filter that performs a custom 5x5 matrix convolution.
CIConvolution9HorizontalA filter that performs a horizontal convolution of 9 elements.
CIConvolution9VerticalA filter that performs a vertical convolution of 9 elements.
CIConvolutionCoreAn abstract class that is the base for convolution filters.
CICopyMachineTransitionA MonoTouch.CoreImage.CITransitionFilter that mimics the effect of a photocopier.
CICropThe CICrop CoreImage filter
CIDarkenBlendModeThe CIDarkenBlendMode CoreImage filter
CIDetectorImage analysis class for face detection.
CIDetectorOptionsOptions for use with face detection. Used with MonoTouch.CoreImage.CIDetector.CreateFaceDetector.
CIDifferenceBlendModeThe CIDifferenceBlendMode CoreImage filter
CIDisintegrateWithMaskTransitionA MonoTouch.CoreImage.CITransitionFilter that uses a mask to define the transition.
CIDissolveTransitionA MonoTouch.CoreImage.CITransitionFilter that performs a cross-dissolve.
CIDistortionFilterAn abstract MonoTouch.CoreImage.CIFilter for distortions.
CIDivideBlendModeA MonoTouch.CoreImage.CIBlendFilter that divides the color values of its MonoTouch.CIBlendFilter.Image and MonoTouch.CoreImage.CIBlendFilter.BackgroundImage.
CIDotScreenA MonoTouch.CoreImage.CIScreenFilter that screens with a halftone dot pattern.
CIEightfoldReflectedTileA MonoTouch.CoreImage.CITileFilter that applies 8-way reflected symmetry.
CIExclusionBlendModeThe CIExclusionBlendMode CoreImage filter
CIExposureAdjustThe CIExposureAdjust CoreImage filter
CIFaceBalanceThe CIFaceBalance CoreImage filter
CIFaceFeatureLocations of the eyes and mouths in a detected face. In video sequences, attempts to maintain a consistent MonoTouch.CoreImage.CIFaceFeature.TrackingID.
CIFalseColorThe CIFalseColor CoreImage filter
CIFeatureAn area of an image in which a MonoTouch.CoreImage.CIDetector has detected a match.
CIFilterCoreImage image filter.
CIFilterAttributesConstants used for CIFilter's attributes
CIFilterCategoryConstants used for CIFilter filtering facilities to find filters by category.
CIFilterInputKeyKeys that can be used to configure the CIFilter input values.
CIFilterOutputKeyKeys that can be used to get output results out of a CIFilter.
CIFlashTransitionA MonoTouch.CoreImage.CITransitionFilter that presents a starburst-like flash.
CIFormatAn enumeration whose values specify color spaces.
CIFourfoldReflectedTileA MonoTouch.CoreImage.CITileFilter that applies 4-way reflected symmetry.
CIFourfoldRotatedTileA MonoTouch.CoreImage.CITileFilter that rotates the source image in 90-degree increments.
CIFourfoldTranslatedTileA MonoTouch.CoreImage.CITileFilter that applies four translations to the source image.
CIGammaAdjustThe CIGammaAdjust CoreImage filter
CIGaussianBlurApplies a Gaussian blur.
CIGaussianGradientThe CIGaussianGradient CoreImage filter
CIGlassDistortionDistorts the input image so that it appears viewed through glass blocks whose geometry corresponds to the MonoTouch.CIGlassDistortion.Texture image.
CIGlideReflectedTileA MonoTouch.CoreImage.CITileFilter that translates and smears the source image.
CIGloomA MonoTouch.CoreImage.CIFilter that dulls the highlights of the source image.
CIHardLightBlendModeThe CIHardLightBlendMode CoreImage filter
CIHatchedScreenA MonoTouch.CoreImage.CIScreenFilter that filters via a hatched halftone pattern.
CIHighlightShadowAdjustThe CIHighlightShadowAdjust CoreImage filter
CIHistogramDisplayFilterRenders a one-dimensional MonoTouch.CoreImage.CIFilter.Image histogram as a typical two-dimensional histogram.
CIHoleDistortionA Xamarin.CoreImage.CIDistortionFilter that distorts pixels around a circular area.
CIHueAdjustThe CIHueAdjust CoreImage filter
CIHueBlendModeThe CIHueBlendMode CoreImage filter
CIImageRepresents a set of instructions to create an image for use by CoreImage.
CIImageInitializationOptionsOptions that can be used when initializing a new MonoTouch.CoreImage.CIImage.
CIImageInitializationOptionsWithMetadataA type of MonoTouch.CoreImage.CIImageInitializationOptions that has additional metadata properties.
CIImageOrientationAn enumeration whose values specify the origin of the MonoTouch.CoreImage.CIImage.
CIKernelA kernel for filters that use custom GPU steps.
CIKernelRoiCallbackCompletion handler for deterimining a region of interest in the source image.
CILanczosScaleTransformA scaling transform that uses Lanczos resampling.
CILightenBlendModeThe CILightenBlendMode CoreImage filter
CILightTunnelA MonoTouch.CoreImage.CIFilter that creates a spiraling effect.
CILinearBurnBlendModeDarkens the image based on the colors of the background image.
CILinearDodgeBlendModeDarkens the image based on the colors of the background image.
CILinearGradientThe CILinearGradient CoreImage filter
CILinearToSRGBToneCurveA filter that maps color intensity from a linear gamma curve to the sRGB color space.
CILineScreenA MonoTouch.CoreImage.CIScreenFilter that simulates a halftone made of lines.
CILuminosityBlendModeThe CILuminosityBlendMode CoreImage filter
CIMaskToAlphaA MonoTouch.CoreImage.CIFilter that converts a grayscale image to an alpha mask.
CIMaximumComponentA MonoTouch.CoreImage.CIFilter that creates a grayscale image from the maximum value of the RGB color values.
CIMaximumCompositingThe CIMaximumCompositing CoreImage filter
CIMinimumComponentA MonoTouch.CoreImage.CIFilter that creates a grayscale image from the minimum component of the RGB values.
CIMinimumCompositingThe CIMinimumCompositing CoreImage filter
CIModTransitionA MonoTouch.CoreImage.CITransitionFilter that reveals the background image via a series of irregularly shaped holes.
CIMotionBlurDocumentation for this section has not yet been entered.
CIMultiplyBlendModeThe CIMultiplyBlendMode CoreImage filter
CIMultiplyCompositingThe CIMultiplyCompositing CoreImage filter
CIOverlayBlendModeThe CIOverlayBlendMode CoreImage filter
CIPerspectiveCorrectionA MonoTouch.CoreImage.CIPerspectiveTransform that is cropped according to the perspective control points, but whose pixels are not transformed.
CIPerspectiveTileA MonoTouch.CoreImage.CIFilter that applies a perspective transform and then tiles the result.
CIPerspectiveTransformA MonoTouch.CoreImage.CIFilter that applies a transform the simulates perspective.
CIPerspectiveTransformWithExtentA filter that alters a portion of the total image based on a perspective transform.
CIPhotoEffectThe base class for photo effect filters.
CIPhotoEffectChromeA filter that exaggerates color of the image producing a vintage look.
CIPhotoEffectFadeA filter that reduces color of the image producing a vintage look.
CIPhotoEffectInstantA filter that that distorts colors in a style reminiscent of instant film.
CIPhotoEffectMonoA filter that produces a low-contrast black-and-white image.
CIPhotoEffectNoirA filter that produces a high-contrast black-and-white image.
CIPhotoEffectProcessA filter that produces a vintage look with exagerrated cool colors.
CIPhotoEffectTonalA filter that produces a black-and-white image with minimal contrast changes.
CIPhotoEffectTransferA filter that produces a vintage look with exagerrated warm colors.
CIPinchDistortionA MonoTouch.CoreImage.CIDistortionFilter that pinches pixels towards a rectangular area.
CIPinLightBlendModeReplaces image colors with the bright colors from the background image.
CIPixellateA MonoTouch.CoreImage.CIFilter that pixelates the original image.
CIQRCodeFeatureA detected QR code.
CIQRCodeGeneratorGenerates a QR code.
CIRadialGradientThe CIRadialGradient CoreImage filter
CIRandomGeneratorA MonoTouch.CoreImage.CIFilter whose pixels are randomly colored.
CIRectangleFeatureA MonoTouch.CoreImage.CIFeature an image space rectange that contains a detected physical rectangle.
CISaturationBlendModeThe CISaturationBlendMode CoreImage filter
CIScreenBlendModeThe CIScreenBlendMode CoreImage filter
CIScreenFilterA MonoTouch.CoreImage.CIFilter that mimics halftone screens.
CISepiaToneThe CISepiaTone CoreImage filter
CISharpenLuminanceA MonoTouch.CoreImage.CIFilter that sharpens the image.
CISixfoldReflectedTileA MonoTouch.CoreImage.CITileFilter that applies 6-way reflected symmetry.
CISixfoldRotatedTileA MonoTouch.CoreImage.CITileFilter that rotates the image in 60-degree increments.
CISmoothLinearGradientA filter that produces a gradient along a linear axis between two endpoints.
CISoftLightBlendModeThe CISoftLightBlendMode CoreImage filter
CISourceAtopCompositingThe CISourceAtopCompositing CoreImage filter
CISourceInCompositingThe CISourceInCompositing CoreImage filter
CISourceOutCompositingThe CISourceOutCompositing CoreImage filter
CISourceOverCompositingThe CISourceOverCompositing CoreImage filter
CISRGBToneCurveToLinearA filter that adjusts tone response in sRGB color space and then maps it to a linear gamma curve.
CIStarShineGeneratorA MonoTouch.CoreImage.CIFilter that simulates lens flare.
CIStraightenFilterThe CIStraightenFilter CoreImage filter
CIStripesGeneratorThe CIStripesGenerator CoreImage filter
CISubtractBlendModeSubtracts the background image pixels from those in the MonoTouch.CoreImage.CIFilter.Image.
CISwipeTransitionA MonoTouch.CoreImage.CITransitionFilter that swipes from one image to the other.
CITemperatureAndTintThe CITemperatureAndTint CoreImage filter
CITileFilterA MonoTouch.CoreImage.CIFilter that applies a filter and then tiles the results.
CIToneCurveThe CIToneCurve CoreImage filter
CITransitionFilterA MonoTouch.CoreImage.CITransitionFilter that animates a transition between two images.
CITriangleKaleidoscopeA MonoTouch.CoreImage.CIFilter that creates a kaleidoscopic effect.
CITwelvefoldReflectedTileA MonoTouch.CoreImage.CITileFilter that applies 12-way reflected symmetry.
CITwirlDistortionA MonoTouch.CoreImage.CIDistortionFilter that rotates pixels around a point.
CIUnsharpMaskA MonoTouch.CoreImage.CIFilter that increases the contrast of edges in the image.
CIVectorA vector for use with Core Image objects such as MonoTouch.CoreImage.CIFilter.
CIVibranceThe CIVibrance CoreImage filter
CIVignetteThe CIVignette CoreImage filter
CIVignetteEffectA filter that modifies the brightness of the outside of an image.
CIVortexDistortionA MonoTouch.CoreImage.CIDistortionFilter that creates a tight spiraling distortion suggestive of a vortex.
CIWarpKernelA kernel for GPU transforms that operate only on geometry.
CIWhitePointAdjustThe CIWhitePointAdjust CoreImage filter
CIZoomBlurDocumentation for this section has not yet been entered.
FaceDetectorAccuracyAn enumeration whose values specify the accuracy of face detection.