Skip to content

Instantly share code, notes, and snippets.

@mpsauce
Created August 26, 2014 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpsauce/f4d4708bf30cafc9959e to your computer and use it in GitHub Desktop.
Save mpsauce/f4d4708bf30cafc9959e to your computer and use it in GitHub Desktop.
This snippet shows adding a gaussian blur using the Quartz Core Framework
CIImage *headerImage = [[CIImage alloc] initWithImage: self.headerImageView.image];
CIFilter *blurFilter = [CIFilter filterWithName: @"CIGaussianBlur"
keysAndValues: kCIInputImageKey, headerImage, @"inputRadius", @(3.0), nil];
CIImage *outputImage = [blurFilter outputImage];
self.context = [CIContext contextWithOptions: nil];
CGImageRef outImage = [self.context createCGImage:outputImage
fromRect: [outputImage extent]];
self.headerImageView.image = [UIImage imageWithCGImage: outImage];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment