New Core Image Filters in iOS 9
New Core Image Filters in iOS 9
Join the DZone community and get the full member experience.Join For Free
WWDC 2015 saw some exciting news for fans of Core Image Filters. Not only are lots of filters, such as blur and convolution, now powered by MetalPerformanceShaders giving some amazing performance improvements, but Apple have implemented parity for available image filters across iOS and OS X.
This gives iOS 43 new image filters that I can't wait to add to my own Nodality application. It also means that code and functionality can be shared across both classes of device and I've already stated thinking about a desktop version of Nodality.
So, what are the new filters? Well, CIFilter has the class method filterNamesInCategories() which returns an array of all available filters. A quick diff between iOS 8 and 9 returns the following:
- CIAreaAverage - Returns a single-pixel image that contains the average color for the region of interest.
- CIAreaMaximum - Returns a single-pixel image that contains the maximum color components for the region of interest.
- CIAreaMaximumAlpha - Returns a single-pixel image that contains the color vector with the maximum alpha value for the region of interest.
- CIAreaMinimum - Returns a single-pixel image that contains the minimum color components for the region of interest.
- CIAreaMinimumAlpha - Returns a single-pixel image that contains the color vector with the minimum alpha value for the region of interest.
- CIBoxBlur - Blurs an image using a box-shaped convolution kernel.
- CICircularWrap - Wraps an image around a transparent circle.
- CICMYKHalftone - Creates a color, halftoned rendition of the source image, using cyan, magenta, yellow, and black inks over a white page.
- CIColumnAverage - Returns a 1-pixel high image that contains the average color for each scan column.
- CIComicEffect - Simulates a comic book drawing by outlining edges and applying a color halftone effect.
- CIConvolution7X7 - Modifies pixel values by performing a 7x7 matrix convolution.
- CICrystallize - Creates polygon-shaped color blocks by aggregating source pixel-color values.
- CIDepthOfField - Simulates a depth of field effect.
- CIDiscBlur - Blurs an image using a disc-shaped convolution kernel.
- CIDisplacementDistortion - Applies the grayscale values of the second image to the first image.
- CIDroste - Recursively draws a portion of an image in imitation of an M. C. Escher drawing.
- CIEdges - Finds all edges in an image and displays them in color.
- CIEdgeWork - Produces a stylized black-and-white rendition of an image that looks similar to a woodblock cutout.
- CIGlassLozenge - Creates a lozenge-shaped lens and distorts the portion of the image over which the lens is placed.
- CIHeightFieldFromMask - Produces a continuous three-dimensional, loft-shaped height field from a grayscale mask.
- CIHexagonalPixellate - Maps an image to colored hexagons whose color is defined by the replaced pixels.
- CIKaleidoscope - Produces a kaleidoscopic image from a source image by applying 12-way symmetry.
- CILenticularHaloGenerator - Simulates a lens flare.
- CILineOverlay - Creates a sketch that outlines the edges of an image in black.
- CIMedianFilter - Computes the median value for a group of neighboring pixels and replaces each pixel value with the median.
- CINoiseReduction - Reduces noise using a threshold value to define what is considered noise.
- CIOpTile - Segments an image, applying any specified scaling and rotation, and then assembles the image again to give an op art appearance.
- CIPageCurlTransition - Transitions from one image to another by simulating a curling page, revealing the new image as the page curls.
- CIPageCurlWithShadowTransition - Transitions from one image to another by simulating a curling page, revealing the new image as the page curls.
- CIParallelogramTile - Warps an image by reflecting it in a parallelogram, and then tiles the result.
- CIPointillize - Renders the source image in a pointillistic style.
- CIRippleTransition - Transitions from one image to another by creating a circular wave that expands from the center point, revealing the new image in the wake of the wave.
- CIRowAverage - Returns a 1-pixel high image that contains the average color for each scan row.
- CIShadedMaterial - Produces a shaded image from a height field.
- CISpotColor - Replaces one or more color ranges with spot colors.
- CISpotLight - Applies a directional spotlight effect to an image.
- CIStretchCrop - Distorts an image by stretching and or cropping it to fit a target size.
- CISunbeamsGenerator - Generates a sun effect.
- CITorusLensDistortion - Creates a torus-shaped lens and distorts the portion of the image over which the lens is placed.
- CITriangleTile - Maps a triangular portion of image to a triangular area and then tiles the result.
For more information on each filter, visit Apple's Core Image Filter Reference.
Published at DZone with permission of Simon Gladman , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.