iOS Developer Library

Developer

CoreImage Framework Reference CIFilter Class Reference

Options
Deployment Target:

On This Page
Language:

CIFilter

Inherits From


Conforms To


Import Statement


Swift

import CoreImage

Objective-C

@import CoreImage;

Availability


Available in iOS 5.0 and later

The CIFilter class produces a CIImage object as output. Typically, a filter takes one or more images as input. Some filters, however, generate an image based on other types of input parameters. The parameters of a CIFilter object are set and retrieved through the use of key-value pairs.

You use the CIFilter object in conjunction with other Core Image classes, such as CIImage, CIContext, and CIColor, to take advantage of the built-in Core Image filters when processing images, creating filter generators, or writing custom filters.

CIFilter objects, are not mutable. A CIFilter object cannot be shared safely among threads. If you app is multithreaded, each thread must create its own CIFilter object. Otherwise, your app could behave unexpectedly.

To get a quick overview of how to set up and use Core Image filters, see Core Image Programming Guide.

Subclassing Notes

You can subclass CIFilter in order to create custom filter effects:

  • By chaining together two or more built-in Core Image filters (iOS and OS X)

  • By using an image-processing kernel that you write (OS X only)

See Core Image Programming Guide for details.

Methods to Override

Regardless of whether your subclass provides its effect by chaining filters or implementing its own kernel, you should:

  • Declare any input parameters as properties whose names are prefixed with input, such as inputImage.

  • Override the setDefaults methods to provide default values for any input parameters you’ve declared.

  • Implement an outputImage method to create a new CIImage with your filter’s effect.

Special Considerations

The CIFilter class automatically manages input parameters when archiving, copying, and deallocating filters. For this reason, your subclass must obey the following guidelines to ensure proper behavior:

  • Store input parameters in instance variables whose names are prefixed with input.

    Don’t use auto-synthesized instance variables, because their names are automatically prefixed with an underscore. Instead, synthesize the property manually. For example:

    @synthesize inputMyParameter;

  • If using manual reference counting, don’t release input parameter instance variables in your dealloc method implementation. The dealloc implementation in the CIFilter class uses key-value coding to automatically sets the values of all input parameters to nil.

  • Creates a CIFilter object for a specific kind of filter.

    Declaration

    Swift

    init!(name name: String!) -> CIFilter

    Objective-C

    + (CIFilter *)filterWithName:(NSString *)name

    Parameters

    name

    The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

    Return Value

    A CIFilter object whose input values are undefined.

    Discussion

    In OS X, after creating a filter with this method you must call setDefaults or set parameters individually by calling setValue:forKey:. In iOS, the filter’s parameters are automatically set to default values.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Creates a CIFilter object for a specific kind of filter and initializes the input values.

    Declaration

    Swift

    init!(name name: String!, withInputParameters params: [NSObject : AnyObject]!) -> CIFilter

    Objective-C

    + (CIFilter *)filterWithName:(NSString *)name withInputParameters:(NSDictionary *)params

    Parameters

    name

    The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

    params

    A list of key-value pairs to set as input values to the filter. Each key is a constant that specifies the name of an input parameter for the filter, and the corresponding value is the value for that parameter. See Core Image Filter Reference for built-in filters and their allowed parameters.

    Return Value

    A CIFilter object whose input values are initialized.

    Discussion

    Use this method to quickly create and configure a CIFilter instance, as in the example below.

    • CIFilter *f = [CIFilter filterWithName: @"CIColorControls"
    • withInputParameters: @{
    • @"inputImage" : inImage,
    • @"inputSaturation" : @0.5,
    • @"inputBrightness" : @1.2,
    • @"inputContrast" : @1.3
    • }];

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 8.0 and later

  • Creates a CIFilter object for a specific kind of filter and initializes the input values with a nil-terminated list of arguments.

    Declaration

    Objective-C

    + (CIFilter *)filterWithName:(NSString *)name keysAndValues:(id)key0, ...

    Parameters

    name

    The name of the filter. You must make sure the name is spelled correctly, otherwise your app will run but not produce any output images. For that reason, you should check for the existence of the filter after calling this method.

    key0,...

    A list of key-value pairs to set as input values to the filter. Each key is a constant that specifies the name of the input value to set, and must be followed by a value. You signal the end of the list by passing a nil value.

    Return Value

    A CIFilter object whose input values are initialized.

    Discussion

    As with all Objective-C methods that accept nil-terminated argument lists, to prevent unintended behavior you must take take care not to pass a nil value before the intended end of the argument list. You can avoid such issues by using the filterWithName:withInputParameters: method to create a filter, expressing the parameter list as a dictionary literal.

    Import Statement

    Objective-C

    @import CoreImage;

    Availability

    Available in iOS 5.0 and later

  • Returns an array of all published filter names that match all the specified categories.

    Declaration

    Swift

    class func filterNamesInCategories(_ categories: [AnyObject]!) -> [AnyObject]!

    Objective-C

    + (NSArray *)filterNamesInCategories:(NSArray *)categories

    Parameters

    categories

    One or more of the filter category keys defined in Filter Category Keys. Pass nil to get all filters in all categories.

    Return Value

    An array that contains all published filter names that match all the categories specified by the categories argument.

    Discussion

    When you pass more than one filter category, this method returns the intersection of the filters in the categories. For example, if you pass the categories kCICategoryBuiltIn and kCICategoryColorAdjustment, you obtain all the filters that are members of both the built-in and color adjustment categories. But if you pass in kCICategoryGenerator and kCICategoryStylize, you will not get any filters returned to you because there are no filters that are members of both the generator and stylize categories. If you want to obtain all stylize and generator filters, you must call the filterNamesInCategories: method for each category separately and then merge the results.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Returns an array of all published filter names in the specified category.

    Declaration

    Swift

    class func filterNamesInCategory(_ category: String!) -> [AnyObject]!

    Objective-C

    + (NSArray *)filterNamesInCategory:(NSString *)category

    Parameters

    category

    A string object that specifies one of the filter categories defined in Filter Category Keys.

    Return Value

    An array that contains all published names of the filter in a category.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • name() name Property

    A name associated with a filter.

    Declaration

    Swift

    func name() -> String!

    Objective-C

    - (NSString *)name

    Discussion

    You use a filter’s name to construct key paths to its attributes when the filter is attached to a Core Animation layer. For example, if a CALayer object has an attached CIFilter instance whose name is myExposureFilter, you can refer to attributes of the filter using a key path such as filters.myExposureFilter.inputEV. Layer animations may also access filter attributes via these key paths.

    The default value for this property is nil.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Returns a dictionary of key-value pairs that describe the filter.

    Declaration

    Swift

    func attributes() -> [NSObject : AnyObject]!

    Objective-C

    - (NSDictionary *)attributes

    Return Value

    A dictionary that contains a key for each input and output parameter for the filter. Each key is a dictionary that contains all the attributes of an input or output parameter.

    Discussion

    For example, the attributes dictionary for the CIColorControls filter contains the following information:

    • CIColorControls:
    • {
    • CIAttributeFilterCategories = (
    • CICategoryColorAdjustment,
    • CICategoryVideo,
    • CICategoryStillImage,
    • CICategoryInterlaced,
    • CICategoryNonSquarePixels,
    • CICategoryBuiltIn
    • );
    • CIAttributeFilterDisplayName = "Color Controls";
    • CIAttributeFilterName = CIColorControls;
    • inputBrightness = {
    • CIAttributeClass = NSNumber;
    • CIAttributeDefault = 0;
    • CIAttributeIdentity = 0;
    • CIAttributeMin = -1;
    • CIAttributeSliderMax = 1;
    • CIAttributeSliderMin = -1;
    • CIAttributeType = CIAttributeTypeScalar;
    • };
    • inputContrast = {
    • CIAttributeClass = NSNumber;
    • CIAttributeDefault = 1;
    • CIAttributeIdentity = 1;
    • CIAttributeMin = 0.25;
    • CIAttributeSliderMax = 4;
    • CIAttributeSliderMin = 0.25;
    • CIAttributeType = CIAttributeTypeScalar;
    • };
    • inputImage = {CIAttributeClass = CIImage; };
    • inputSaturation = {
    • CIAttributeClass = NSNumber;
    • CIAttributeDefault = 1;
    • CIAttributeIdentity = 1;
    • CIAttributeMin = 0;
    • CIAttributeSliderMax = 3;
    • CIAttributeSliderMin = 0;
    • CIAttributeType = CIAttributeTypeScalar;
    • };
    • outputImage = {CIAttributeClass = CIImage; };
    • }

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Returns an array that contains the names of the input parameters to the filter.

    Declaration

    Swift

    func inputKeys() -> [AnyObject]!

    Objective-C

    - (NSArray *)inputKeys

    Return Value

    An array that contains the names of all input parameters to the filter.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Returns an array that contains the names of the output parameters for the filter.

    Declaration

    Swift

    func outputKeys() -> [AnyObject]!

    Objective-C

    - (NSArray *)outputKeys

    Return Value

    An array that contains the names of all output parameters from the filter.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Returns a CIImage object that encapsulates the operations configured in the filter. (read-only)

    Declaration

    Swift

    var outputImage: CIImage! { get }

    Objective-C

    @property(readonly, nonatomic) CIImage *outputImage

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Sets all input values for a filter to default values.

    Declaration

    Swift

    func setDefaults()

    Objective-C

    - (void)setDefaults

    Discussion

    Input values whose default values are not defined are left unchanged.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 5.0 and later

  • Serializes filter parameters into XMP form that is suitable for embedding in an image.

    Declaration

    Swift

    class func serializedXMPFromFilters(_ filters: [AnyObject]!, inputImageExtent extent: CGRect) -> NSData!

    Objective-C

    + (NSData *)serializedXMPFromFilters:(NSArray *)filters inputImageExtent:(CGRect)extent

    Parameters

    filters

    The array of filters to serialize. See Discussion for the filters that can be serialized.

    extent

    The extent of the input image to the filter.

    Discussion

    At this time the only filters classes that can be serialized using this method are, CIAffineTransform, CICrop, and the filters returned by the CIImage methods autoAdjustmentFilters and autoAdjustmentFiltersWithOptions:. The parameters of other filter classes will not be serialized.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 6.0 and later

  • Returns an array of filter objects de-serialized from XMP data.

    Declaration

    Swift

    class func filterArrayFromSerializedXMP(_ xmpData: NSData!, inputImageExtent extent: CGRect, error outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    + (NSArray *)filterArrayFromSerializedXMP:(NSData *)xmpData inputImageExtent:(CGRect)extent error:(NSError **)outError

    Parameters

    xmpData

    The XMP data created previously by calling serializedXMPFromFilters:inputImageExtent:.

    extent

    The extent of the image from which the XMP data was extracted.

    outError

    The address of an NSError object for receiving errors, otherwise nil.

    Import Statement

    Objective-C

    @import CoreImage;

    Swift

    import CoreImage

    Availability

    Available in iOS 6.0 and later

  • Attributes for a filter and its parameters.

    Declaration

    Swift

    let kCIAttributeFilterName: String let kCIAttributeFilterDisplayName: String let kCIAttributeFilterCategories: String let kCIAttributeClass: String let kCIAttributeType: String let kCIAttributeMin: String let kCIAttributeMax: String let kCIAttributeSliderMin: String let kCIAttributeSliderMax: String let kCIAttributeDefault: String let kCIAttributeIdentity: String let kCIAttributeName: String let kCIAttributeDisplayName: String

    Objective-C

    NSString *kCIAttributeFilterName; NSString *kCIAttributeFilterDisplayName; NSString *kCIAttributeFilterCategories; NSString *kCIAttributeClass; NSString *kCIAttributeType; NSString *kCIAttributeMin; NSString *kCIAttributeMax; NSString *kCIAttributeSliderMin; NSString *kCIAttributeSliderMax; NSString *kCIAttributeDefault; NSString *kCIAttributeIdentity; NSString *kCIAttributeName; NSString *kCIAttributeDisplayName;

    Constants

    • kCIAttributeFilterName

      kCIAttributeFilterName

      The filter name, specified as an NSString object.

      Available in iOS 5.0 and later

    • kCIAttributeFilterDisplayName

      kCIAttributeFilterDisplayName

      The localized version of the filter name that is displayed in the user interface.

      Available in iOS 5.0 and later

    • kCIAttributeFilterCategories

      kCIAttributeFilterCategories

      An array of filter category keys that specifies all the categories in which the filter is a member.

      Available in iOS 5.0 and later

    • kCIAttributeClass

      kCIAttributeClass

      The class name of the filter.

      Available in iOS 5.0 and later

    • kCIAttributeType

      kCIAttributeType

      One of the attribute types described in Data Type Attributes.

      Available in iOS 5.0 and later

    • kCIAttributeMin

      kCIAttributeMin

      The minimum value for a filter parameter, specified as a floating-point value.

      Available in iOS 5.0 and later

    • kCIAttributeMax

      kCIAttributeMax

      The maximum value for a filter parameter, specified as a floating-point value.

      Available in iOS 5.0 and later

    • kCIAttributeSliderMin

      kCIAttributeSliderMin

      The minimum value, specified as a floating-point value, to use for a slider that controls input values for a filter parameter.

      Available in iOS 5.0 and later

    • kCIAttributeSliderMax

      kCIAttributeSliderMax

      The maximum value, specified as a floating-point value, to use for a slider that controls input values for a filter parameter.

      Available in iOS 5.0 and later

    • kCIAttributeDefault

      kCIAttributeDefault

      The default value, specified as a floating-point value, for a filter parameter.

      Available in iOS 5.0 and later

    • kCIAttributeIdentity

      kCIAttributeIdentity

      If supplied as a value for a parameter, the parameter has no effect on the input image.

      Available in iOS 5.0 and later

    • kCIAttributeName

      kCIAttributeName

      The name of the attribute.

      Available in iOS 5.0 and later

    • kCIAttributeDisplayName

      kCIAttributeDisplayName

      The localized display name of the attribute.

      Available in iOS 5.0 and later

    Discussion

    Attribute keys are used for the attribute dictionary of a filter. Most entries in the attribute dictionary are optional. The attribute kCIAttributeFilterName is mandatory. For a parameter, the attribute kCIAttributeClass is mandatory because it specifies the class name of the filter.

    A parameter of type NSNumber does not necessarily need the attributes kCIAttributeMin and kCIAttributeMax. These attributes are not present when the parameter has no upper or lower bounds. For example, the Gaussian blur filter has a radius parameter with a minimum of 0 but no maximum value to indicate that all nonnegative values are valid.

  • Numeric data types.

    Declaration

    Swift

    let kCIAttributeTypeTime: String let kCIAttributeTypeScalar: String let kCIAttributeTypeDistance: String let kCIAttributeTypeAngle: String let kCIAttributeTypeBoolean: String let kCIAttributeTypeInteger: String let kCIAttributeTypeCount: String

    Objective-C

    NSString *kCIAttributeTypeTime; NSString *kCIAttributeTypeScalar; NSString *kCIAttributeTypeDistance; NSString *kCIAttributeTypeAngle; NSString *kCIAttributeTypeBoolean; NSString *kCIAttributeTypeInteger; NSString *kCIAttributeTypeCount;

    Constants

    • kCIAttributeTypeTime

      kCIAttributeTypeTime

      A parametric time for transitions, specified as a floating-point value in the range of 0.0 to 1.0.

      Available in iOS 5.0 and later

    • kCIAttributeTypeScalar

      kCIAttributeTypeScalar

      A scalar value.

      Available in iOS 5.0 and later

    • kCIAttributeTypeDistance

      kCIAttributeTypeDistance

      A distance.

      Available in iOS 5.0 and later

    • kCIAttributeTypeAngle

      kCIAttributeTypeAngle

      An angle.

      Available in iOS 5.0 and later

    • kCIAttributeTypeBoolean

      kCIAttributeTypeBoolean

      A Boolean value.

      Available in iOS 5.0 and later

    • kCIAttributeTypeInteger

      kCIAttributeTypeInteger

      An integer value.

      Available in iOS 5.0 and later

    • kCIAttributeTypeCount

      kCIAttributeTypeCount

      A positive integer value.

      Available in iOS 5.0 and later

  • Vector data types.

    Declaration

    Swift

    let kCIAttributeTypePosition: String let kCIAttributeTypeOffset: String let kCIAttributeTypePosition3: String let kCIAttributeTypeRectangle: String

    Objective-C

    NSString *kCIAttributeTypePosition; NSString *kCIAttributeTypeOffset; NSString *kCIAttributeTypePosition3; NSString *kCIAttributeTypeRectangle

    Constants

    • kCIAttributeTypePosition

      kCIAttributeTypePosition

      A two-dimensional location in the working coordinate space. (A 2-element vector type.)

      Available in iOS 5.0 and later

    • kCIAttributeTypeOffset

      kCIAttributeTypeOffset

      An offset. (A 2-element vector type.)

      Available in iOS 5.0 and later

    • kCIAttributeTypePosition3

      kCIAttributeTypePosition3

      A three-dimensional location in the working coordinate space. (A 3-element vector type.)

      Available in iOS 5.0 and later

    • kCIAttributeTypeRectangle

      kCIAttributeTypeRectangle

      A Core Image vector that specifies the x and y values of the rectangle origin, and the width (w) and height (h) of the rectangle. The vector takes the form [x, y, w, h]. (A 4-element vector type.)

      Available in iOS 5.0 and later

  • Color types.

    Declaration

    Swift

    let kCIAttributeTypeColor: String

    Objective-C

    NSString *kCIAttributeTypeColor;

    Constants

    • kCIAttributeTypeColor

      kCIAttributeTypeColor

      A Core Image color (CIColor object) that specifies red, green, and blue component values.

      Available in iOS 5.0 and later

  • Image Types

    Declaration

    Swift

    let kCIAttributeTypeImage: String let kCIAttributeTypeTransform: String

    Objective-C

    NSString *kCIAttributeTypeImage; NSString *kCIAttributeTypeTransform;

    Constants

    • kCIAttributeTypeImage

      kCIAttributeTypeImage

      A CIImage object.

      Available in iOS 5.0 and later

    • kCIAttributeTypeTransform

      kCIAttributeTypeTransform

      An CGAffineTransform is associated with attribute.

      Available in iOS 5.0 and later

  • Categories of filters.

    Declaration

    Swift

    let kCICategoryDistortionEffect: String let kCICategoryGeometryAdjustment: String let kCICategoryCompositeOperation: String let kCICategoryHalftoneEffect: String let kCICategoryColorAdjustment: String let kCICategoryColorEffect: String let kCICategoryTransition: String let kCICategoryTileEffect: String let kCICategoryGenerator: String let kCICategoryReduction: String let kCICategoryGradient: String let kCICategoryStylize: String let kCICategorySharpen: String let kCICategoryBlur: String let kCICategoryVideo: String let kCICategoryStillImage: String let kCICategoryInterlaced: String let kCICategoryNonSquarePixels: String let kCICategoryHighDynamicRange: String let kCICategoryBuiltIn: String

    Objective-C

    NSString *kCICategoryDistortionEffect; NSString *kCICategoryGeometryAdjustment; NSString *kCICategoryCompositeOperation; NSString *kCICategoryHalftoneEffect; NSString *kCICategoryColorAdjustment; NSString *kCICategoryColorEffect; NSString *kCICategoryTransition; NSString *kCICategoryTileEffect; NSString *kCICategoryGenerator; NSString *kCICategoryReduction; NSString *kCICategoryGradient; NSString *kCICategoryStylize; NSString *kCICategorySharpen; NSString *kCICategoryBlur; NSString *kCICategoryVideo; NSString *kCICategoryStillImage; NSString *kCICategoryInterlaced; NSString *kCICategoryNonSquarePixels; NSString *kCICategoryHighDynamicRange ; NSString *kCICategoryBuiltIn;

    Constants

    • kCICategoryDistortionEffect

      kCICategoryDistortionEffect

      A filter that reshapes an image by altering its geometry to create a 3D effect. Using distortion filters, you can displace portions of an image, apply lens effects, make a bulge in an image, and perform other operation to achieve an artistic effect.

      Available in iOS 5.0 and later

    • kCICategoryGeometryAdjustment

      kCICategoryGeometryAdjustment

      A filter that changes the geometry of an image. Some of these filters are used to warp an image to achieve an artistic effects, but these filters can also be used to correct problems in the source image. For example, you can apply an affine transform to straighten an image that is rotated with respect to the horizon.

      Available in iOS 5.0 and later

    • kCICategoryCompositeOperation

      kCICategoryCompositeOperation

      A filter operates on two image sources, using the color values of one image to operate on the other. Composite filters perform computations such as computing maximum values, minimum values, and multiplying values between input images. You can use compositing filters to add effects to an image, crop an image, and achieve a variety of other effects.

      Available in iOS 5.0 and later

    • kCICategoryHalftoneEffect

      kCICategoryHalftoneEffect

      A filter that simulates a variety of halftone screens, to mimic the halftone process used in print media. The output of these filters has the familiar “newspaper” look of the various dot patterns. Filters are typically named after the pattern created by the virtual halftone screen, such as circular screen or hatched screen.

      Available in iOS 5.0 and later

    • kCICategoryColorAdjustment

      kCICategoryColorAdjustment

      A filter that changes color values. Color adjustment filters are used to eliminate color casts, adjust hue, and correct brightness and contrast. Color adjustment filters do not perform color management; ColorSync performs color management. You can use Quartz 2D to specify the color space associated with an image. For more information, see Color Management Overview and Quartz 2D Programming Guide.

      Available in iOS 5.0 and later

    • kCICategoryColorEffect

      kCICategoryColorEffect

      A filter that modifies the color of an image to achieve an artistic effect. Examples of color effect filters include filters that change a color image to a sepia image or a monochrome image or that produces such effects as posterizing.

      Available in iOS 5.0 and later

    • kCICategoryTransition

      kCICategoryTransition

      A filter that provides a bridge between two or more images by applying a motion effect that defines how the pixels of a source image yield to that of the destination image.

      Available in iOS 5.0 and later

    • kCICategoryTileEffect

      kCICategoryTileEffect

      A filter that typically applies an effect to an image and then create smaller versions of the image (tiles), which are then laid out to create a pattern that’s infinite in extent.

      Available in iOS 5.0 and later

    • kCICategoryGenerator

      kCICategoryGenerator

      A filter that generates a pattern, such as a solid color, a checkerboard, or a star shine. The generated output is typically used as input to another filter.

      Available in iOS 5.0 and later

    • kCICategoryReduction

      kCICategoryReduction

      A filter that reduces image data. These filters are used to solve image analysis problems.

      Available in iOS 5.0 and later

    • kCICategoryGradient

      kCICategoryGradient

      A filter that generates a fill whose color varies smoothly. Exactly how color varies depends on the type of gradient—linear, radial, or Gaussian.

      Available in iOS 5.0 and later

    • kCICategoryStylize

      kCICategoryStylize

      A filter that makes a photographic image look as if it was painted or sketched. These filters are typically used alone or in combination with other filters to achieve artistic effects.

      Available in iOS 5.0 and later

    • kCICategorySharpen

      kCICategorySharpen

      A filter that sharpens images, increasing the contrast between the edges in an image. Examples of sharpen filters are unsharp mask and sharpen luminance.

      Available in iOS 5.0 and later

    • kCICategoryBlur

      kCICategoryBlur

      A filter that softens images, decreasing the contrast between the edges in an image. Examples of blur filters are Gaussian blur and zoom blur.

      Available in iOS 5.0 and later

    • kCICategoryVideo

      kCICategoryVideo

      A filter that works on video images.

      Available in iOS 5.0 and later

    • kCICategoryStillImage

      kCICategoryStillImage

      A filter that works on still images.

      Available in iOS 5.0 and later

    • kCICategoryInterlaced

      kCICategoryInterlaced

      A filter that works on interlaced images.

      Available in iOS 5.0 and later

    • kCICategoryNonSquarePixels

      kCICategoryNonSquarePixels

      A filter that works on non-square pixels.

      Available in iOS 5.0 and later

    • kCICategoryHighDynamicRange

      kCICategoryHighDynamicRange

      A filter that works on high dynamic range pixels.

      Available in iOS 5.0 and later

    • kCICategoryBuiltIn

      kCICategoryBuiltIn

      A filter provided by Core Image. This distinguishes built-in filters from plug-in filters.

      Available in iOS 5.0 and later

  • Keys for input parameters to filters.

    Declaration

    Swift

    let kCIOutputImageKey: String let kCIInputBackgroundImageKey: String let kCIInputImageKey: String let kCIInputTimeKey: String let kCIInputTransformKey: String let kCIInputScaleKey: String let kCIInputAspectRatioKey: String let kCIInputCenterKey: String let kCIInputRadiusKey: String let kCIInputAngleKey: String let kCIInputWidthKey: String let kCIInputSharpnessKey: String let kCIInputIntensityKey: String let kCIInputEVKey: String let kCIInputSaturationKey: String let kCIInputColorKey: String let kCIInputBrightnessKey: String let kCIInputContrastKey: String let kCIInputMaskImageKey: String let kCIInputTargetImageKey: String let kCIInputExtentKey: String let kCIInputVersionKey: String

    Objective-C

    NSString *kCIOutputImageKey; NSString *kCIInputBackgroundImageKey; NSString *kCIInputImageKey; NSString *kCIInputTimeKey; NSString *kCIInputTransformKey; NSString *kCIInputScaleKey; NSString *kCIInputAspectRatioKey; NSString *kCIInputCenterKey; NSString *kCIInputRadiusKey; NSString *kCIInputAngleKey; NSString *kCIInputWidthKey; NSString *kCIInputSharpnessKey; NSString *kCIInputIntensityKey; NSString *kCIInputEVKey; NSString *kCIInputSaturationKey; NSString *kCIInputColorKey; NSString *kCIInputBrightnessKey; NSString *kCIInputContrastKey; NSString *kCIInputMaskImageKey; NSString *kCIInputTargetImageKey; NSString *kCIInputExtentKey; NSString *kCIInputVersionKey;

    Constants

    • kCIOutputImageKey

      kCIOutputImageKey

      A key for the CIImage object produced by a filter.

      Available in OS X v10.5 and later. Available in iOS 5.0 and later

    • kCIInputBackgroundImageKey

      kCIInputBackgroundImageKey

      A key for the CIImage object to use as a background image.

      Available in OS X v10.5 and later. Available in iOS 5.0 and later

    • kCIInputImageKey

      kCIInputImageKey

      A key for the CIImage object to use as an input image. For filters that also use a background image, this key refers to the foreground image.

      Available in OS X v10.5 and later. Available in iOS 5.0 and later

    • kCIInputTimeKey

      kCIInputTimeKey

      A key for z scalar value (NSNumber) that specifies a time.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputTransformKey

      kCIInputTransformKey

      A key for an NSAffineTransform object that specifies a transformation to apply.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputScaleKey

      kCIInputScaleKey

      A key for a scalar value (NSNumber) that specifies the amount of the effect.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputAspectRatioKey

      kCIInputAspectRatioKey

      A key for a scalar value (NSNumber) that specifies a ratio.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputCenterKey

      kCIInputCenterKey

      A key for a CIVector object that specifies the center of the area, as x and y- coordinates, to be filtered.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputRadiusKey

      kCIInputRadiusKey

      A key for a scalar value (NSNumber) that specifies that specifies the distance from the center of an effect.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputAngleKey

      kCIInputAngleKey

      A key for a scalar value (NSNumber) that specifies an angle.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputWidthKey

      kCIInputWidthKey

      A key for a scalar value (NSNumber) that specifies the width of the effect.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputSharpnessKey

      kCIInputSharpnessKey

      A key for a scalar value (NSNumber) that specifies the amount of sharpening to apply.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputIntensityKey

      kCIInputIntensityKey

      A key for a scalar value (NSNumber) that specifies an intensity value.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputEVKey

      kCIInputEVKey

      A key for a scalar value (NSNumber) that specifies how many F-stops brighter or darker the image should be.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputSaturationKey

      kCIInputSaturationKey

      A key for a scalar value (NSNumber) that specifies the amount to adjust the saturation.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputColorKey

      kCIInputColorKey

      A key for a CIColor object that specifies a color value.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputBrightnessKey

      kCIInputBrightnessKey

      A key for a scalar value (NSNumber) that specifies a brightness level.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputContrastKey

      kCIInputContrastKey

      A key for a scalar value (NSNumber) that specifies a contrast level.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputMaskImageKey

      kCIInputMaskImageKey

      A key for a CIImage object to use as a mask.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputTargetImageKey

      kCIInputTargetImageKey

      A key for a CIImage object that is the target image for a transition.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputExtentKey

      kCIInputExtentKey

      A key for a CIVector object that specifies a rectangle that defines the extent of the effect.

      Available in OS X v10.5 and later. Not available in iOS

    • kCIInputVersionKey

      kCIInputVersionKey

      A key for an NSNumber object that specifies a version number.

      Not available in OS X. Available in iOS 6.0 and later.

    Discussion

    These keys represent some of the most commonly used input parameters. A filter can use other kinds of input parameters.