CoreImage Namespace

Accelerated image processing.

Remarks

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 CoreGraphics, CoreVideo and 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 CoreImage.CIDetector class by calling the CoreImage.CIDetector.CreateFaceDetector(CoreImage.CIContext, bool) method which returns an array of CoreImage.CIFeature objects with any detected face features found.

Auto-adjustments are implemented by calling the 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);
	

Classes

TypeReason
CIAccordionFoldTransitionAnimates a transition by creating an accordion-fold effect on the source image.
CIAdditionCompositingThe CIAdditionCompositing CoreImage filter.
CIAffineClampA CoreImage.CIAffineFilter that extends the border pixels to the post-transform boundaries.
CIAffineFilterAn abstract class that defines a CoreImage.CIFilter that performs an affine transform on an image and then performs a filtering operation on the transformed image.
CIAffineTileA 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 CoreImage.CIImage.GetAutoAdjustmentFilters, limits the results.
CIAztecCodeGeneratorGenerates an Aztec code for the specified CoreImage.CIAztecCodeGenerator.Message.
CIBarsSwipeTransitionA CoreImage.CITransitionFilter that animates a transition by moving a bar over the source image.
CIBlendFilterAn abstract CoreImage.CIFilter that combines a background and foreground image.
CIBlendWithAlphaMaskA CoreImage.CIBlendWithMask that uses a mask image to blend foreground and background images.
CIBlendWithMaskA CoreImage.CIBlendFilter that uses a grayscale mask to blends its foreground and background images.
CIBloomA CoreImage.CIFilter that creates an edge-flow effect.
CIBumpDistortionA 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 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
CIColorKernelDocumentation for this section has not yet been entered.
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 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 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 CoreImage.CIDetector.CreateFaceDetector.
CIDifferenceBlendModeThe CIDifferenceBlendMode CoreImage filter
CIDisintegrateWithMaskTransitionA CoreImage.CITransitionFilter that uses a mask to define the transition.
CIDissolveTransitionA CoreImage.CITransitionFilter that performs a cross-dissolve.
CIDistortionFilterAn abstract CoreImage.CIFilter for distortions.
CIDivideBlendModeA CoreImage.CIBlendFilter that divides the color values of its CIBlendFilter.Image and CoreImage.CIBlendFilter.BackgroundImage.
CIDotScreenA CoreImage.CIScreenFilter that screens with a halftone dot pattern.
CIEightfoldReflectedTileA 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 CoreImage.CIFaceFeature.TrackingID.
CIFalseColorThe CIFalseColor CoreImage filter
CIFeatureAn area of an image in which a 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 CoreImage.CITransitionFilter that presents a starburst-like flash.
CIFormatAn enumeration whose values specify color spaces.
CIFourfoldReflectedTileA CoreImage.CITileFilter that applies 4-way reflected symmetry.
CIFourfoldRotatedTileA CoreImage.CITileFilter that rotates the source image in 90-degree increments.
CIFourfoldTranslatedTileA 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 CIGlassDistortion.Texture image.
CIGlideReflectedTileA CoreImage.CITileFilter that translates and smears the source image.
CIGloomA CoreImage.CIFilter that dulls the highlights of the source image.
CIHardLightBlendModeThe CIHardLightBlendMode CoreImage filter
CIHatchedScreenA CoreImage.CIScreenFilter that filters via a hatched halftone pattern.
CIHighlightShadowAdjustThe CIHighlightShadowAdjust CoreImage filter
CIHistogramDisplayFilterRenders a one-dimensional 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 CoreImage.CIImage.
CIImageInitializationOptionsWithMetadataA type of CoreImage.CIImageInitializationOptions that has additional metadata properties.
CIImageOrientationAn enumeration whose values specify the origin of the CoreImage.CIImage.
CIKernelDocumentation for this section has not yet been entered.
CIKernelRoiCallbackDocumentation for this section has not yet been entered.
CILanczosScaleTransformA scaling transform that uses Lanczos resampling.
CILightenBlendModeThe CILightenBlendMode CoreImage filter
CILightTunnelA 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 CoreImage.CIScreenFilter that simulates a halftone made of lines.
CILuminosityBlendModeThe CILuminosityBlendMode CoreImage filter
CIMaskToAlphaA CoreImage.CIFilter that converts a grayscale image to an alpha mask.
CIMaximumComponentA CoreImage.CIFilter that creates a grayscale image from the maximum value of the RGB color values.
CIMaximumCompositingThe CIMaximumCompositing CoreImage filter
CIMinimumComponentA CoreImage.CIFilter that creates a grayscale image from the minimum component of the RGB values.
CIMinimumCompositingThe CIMinimumCompositing CoreImage filter
CIModTransitionA CoreImage.CITransitionFilter that reveals the background image via a series of irregularly shaped holes.
CIMultiplyBlendModeThe CIMultiplyBlendMode CoreImage filter
CIMultiplyCompositingThe CIMultiplyCompositing CoreImage filter
CIOverlayBlendModeThe CIOverlayBlendMode CoreImage filter
CIPerspectiveCorrectionA CoreImage.CIPerspectiveTransform that is cropped according to the perspective control points, but whose pixels are not transformed.
CIPerspectiveTileA CoreImage.CIFilter that applies a perspective transform and then tiles the result.
CIPerspectiveTransformA 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 CoreImage.CIDistortionFilter that pinches pixels towards a rectangular area.
CIPinLightBlendModeReplaces image colors with the bright colors from the background image.
CIPixellateA CoreImage.CIFilter that pixelates the original image.
CIQRCodeFeatureDocumentation for this section has not yet been entered.
CIQRCodeGeneratorGenerates a QR code.
CIRadialGradientThe CIRadialGradient CoreImage filter
CIRandomGeneratorA CoreImage.CIFilter whose pixels are randomly colored.
CIRectangleFeatureA CoreImage.CIFeature describing a rectangle.
CISaturationBlendModeThe CISaturationBlendMode CoreImage filter
CIScreenBlendModeThe CIScreenBlendMode CoreImage filter
CIScreenFilterA CoreImage.CIFilter that mimics halftone screens.
CISepiaToneThe CISepiaTone CoreImage filter
CISharpenLuminanceA CoreImage.CIFilter that sharpens the image.
CISixfoldReflectedTileA CoreImage.CITileFilter that applies 6-way reflected symmetry.
CISixfoldRotatedTileA 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 CoreImage.CIFilter that simulates lens flare.
CIStraightenFilterThe CIStraightenFilter CoreImage filter
CIStripesGeneratorThe CIStripesGenerator CoreImage filter
CISubtractBlendModeSubtracts the background image pixels from those in the CoreImage.CIFilter.Image.
CISwipeTransitionA CoreImage.CITransitionFilter that swipes from one image to the other.
CITemperatureAndTintThe CITemperatureAndTint CoreImage filter
CITileFilterA CoreImage.CIFilter that applies a filter and then tiles the results.
CIToneCurveThe CIToneCurve CoreImage filter
CITransitionFilterA CoreImage.CITransitionFilter that animates a transition between two images.
CITriangleKaleidoscopeA CoreImage.CIFilter that creates a kaleidoscopic effect.
CITwelvefoldReflectedTileA CoreImage.CITileFilter that applies 12-way reflected symmetry.
CITwirlDistortionA CoreImage.CIDistortionFilter that rotates pixels around a point.
CIUnsharpMaskA CoreImage.CIFilter that increases the contrast of edges in the image.
CIVectorA vector for use with Core Image objects such as CoreImage.CIFilter.
CIVibranceThe CIVibrance CoreImage filter
CIVignetteThe CIVignette CoreImage filter
CIVignetteEffectA filter that modifies the brightness of the outside of an image.
CIVortexDistortionA CoreImage.CIDistortionFilter that creates a tight spiraling distortion suggestive of a vortex.
CIWarpKernelDocumentation for this section has not yet been entered.
CIWhitePointAdjustThe CIWhitePointAdjust CoreImage filter
FaceDetectorAccuracyAn enumeration whose values specify the accuracy of face detection.