Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does iOS 5 support blur CoreImage fiters?

Tags:

According to the documentation it should support blurring, note the "Available in iOS 5.0 and later":

CIFilter Class Reference

But according to the device, it doesn't:

[CIFilter filterNamesInCategory:kCICategoryBlur]; 

returns nothing.

According to the following only these filters are available on my iPhone and Simulator (which are both running 5.0):

[CIFilter filterNamesInCategory:kCICategoryBuiltIn]  CIAdditionCompositing, CIAffineTransform, CICheckerboardGenerator, CIColorBlendMode, CIColorBurnBlendMode, CIColorControls, CIColorCube, CIColorDodgeBlendMode, CIColorInvert, CIColorMatrix, CIColorMonochrome, CIConstantColorGenerator, CICrop, CIDarkenBlendMode, CIDifferenceBlendMode, CIExclusionBlendMode, CIExposureAdjust, CIFalseColor, CIGammaAdjust, CIGaussianGradient, CIHardLightBlendMode, CIHighlightShadowAdjust, CIHueAdjust, CIHueBlendMode, CILightenBlendMode, CILinearGradient, CILuminosityBlendMode, CIMaximumCompositing, CIMinimumCompositing, CIMultiplyBlendMode, CIMultiplyCompositing, CIOverlayBlendMode, CIRadialGradient, CISaturationBlendMode, CIScreenBlendMode, CISepiaTone, CISoftLightBlendMode, CISourceAtopCompositing, CISourceInCompositing, CISourceOutCompositing, CISourceOverCompositing, CIStraightenFilter, CIStripesGenerator, CITemperatureAndTint, CIToneCurve, CIVibrance, CIVignette, CIWhitePointAdjust 
like image 935
lmirosevic Avatar asked Dec 16 '11 01:12

lmirosevic


People also ask

What does the blur content Filter do?

Blur filters soften, haze, cloud, fuzz, or distort specific areas of a picture or the entire image. Photoshop Blur filters are designed primarily for retouching images—to soften, haze, cloud, fuzz, or distort specific areas of a picture or the entire image.

What is CIImage?

A CIImage is a immutable object that represents an image. It is not an image. It only has the image data associated with it. It has all the information necessary to produce an image. You typically use CIImage objects in conjunction with other Core Image classes such as CIFilter, CIContext, CIColor, and CIVector.


1 Answers

While Core Image on iOS 5.0 lacks blur filters, there is still a way to get GPU-accelerated blurs of images and video. My open source GPUImage framework has multiple blur types, including Gaussian (using the GPUImageGaussianBlurFilter for a general Gaussian or the GPUImageFastBlurFilter for a hardware-optimized 9-hit Gaussian), box (using a GPUImageBoxBlurFilter), median (using a GPUImageMedianFilter), and a bilateral blur (using a GPUImageBilateralBlurFilter).

I describe the shaders used to pull off the hardware-optimized Gaussian blur in this answer, and you can examine the code I use for the rest within the framework. These filters run tens of times faster than any CPU-bound routine I've tried yet.

I've also incorporated these blurs into multi-stage processing effects, like unsharp masking, tilt-shift filtering, Canny edge detection, and Harris corner detection, all of which are available as filters within this framework.

like image 143
Brad Larson Avatar answered Sep 20 '22 03:09

Brad Larson