what's a core image? an image-processing framework on ios and os x
DESCRIPTION
Flatiron students Steven Zhou and Heidi Hansen explain how core images work on iOS and OS X to help developers process images efficiently without dealing with low level interactions with GPU or CPU. TRANSCRIPT
Core ImageSteve Zhou & Heidi Hansen
What is a Digital Image?
• It’s a collection of pixels and each pixel represents a specific color.
• Combining hundreds and thousands of pixels together forms a digital image.
• It’s a 2-dimensional arrays of pixels: X and Y or Rows and Columns.
• Usually digital image refers to raster image or bitmap image.
What is Core Image?
•It’s an image processing framework on both iOS and OS X. It was first introduced in iOS 5 and previously was only available on OS X.
•Its designed to do “real-time” image processing at pixel level for both still image and video.
•It operates on image data types from multiple sources. ex: Core Graphics,Core Video, Image I/O
•It allows developers to process images easily and efficiently without dealing with low level interactions with GPU or CPU.
•It provides more than 90 built-in image processing filters in iOS, Feature detection capability, and support for automatic image enhancement.
Key Core Image Classes• CIImage:
1. An object that represents an image. 2. You can create CIImage object with different inputs.
• CIFilter: 1. An object that represents an effect. 2. Has at least one input parameter. 3. Produces a CIImage object.
• CIContext: 1.An object that draws the result produced by CIFilter using either CPU or GPU rendering path.
Apply Filter To An Image
1. CIContext *context = [CIContext contextWithOptions:nil];
2. CIImage *beginImage =[[CIImage alloc] initWithImage:[UIImage imageNamed:@“waterfall.jpg”]];
3. CIFilter *filter = [CIFilter filterWithName:@“CIGammaAdjust"];" " [filter setValue:beginImage forKey:kCIInputImageKey];" " [filter setValue:@2.0 forKey:@"inputPower"];" "4. CIImage *resultImage = [filter outputImage];"!5. CGImageRef cgimage = [context createCGImage:resultImage fromRect:[resultImage extent]];
6. UIImage *newImage = [UIImage imageWithCGImage:cgimage];"
Chaining Multiple Filters1.CIImage *beginImage =[[CIImage alloc] initWithImage:[UIImage
imageNamed:@“waterfall.jpg”]];!
2.CIImage *firstOutPutImage=[CIFilter filterWithName:@"CISepiaTone" keysAndValues: kCIInputImageKey beginImage, @"inputIntensity", @0.8, nil].outputImage;!
3.CIImage *secondOutPutImage=[CIFilter filterWithName:@"CIHueAdjust" keysAndValues: kCIInputImageKey firstOutPutImage, @"inputIntensity", @0.8, nil].outputImage;!
4.CIImage *thirdOutPutImage=[CIFilter filterWithName:@"CIVibrance" keysAndValues: kCIInputImageKey secondOutPutImage, @"inputIntensity", @0.8, nil].outputImage;!!!!!!
begin Image
CISepiaTone CIHueAdjust CIVibrance
Core Image Built-In Filters • CIBoxBlur
• CIDiscBlur
• CIGaussianBlur
• CIMedianFilter
• CIMinimumComponent
• CIPhotoEffectChrome
• CIPhotoEffectFade
• CIPhotoEffectInstant
• CICircularScreen
• CICMYKHalftone
• CIDotScreen
• CIHatchedScreen
• CIAffineClamp
• CIAffineTile
• CIEightfoldReflectedTile
• CIFourfoldReflectedTile
• CIFourfoldRotatedTile
• CIOverlayBlendMode
• CISaturationBlendMode
• CIScreenBlendMode
• CISoftLightBlendMode
• CIColorMap
• CIColorMonochrome
• CIColorPosterize
• CIFalseColor
Steve Zhou & Heidi Hansen !
Thanks! Demo/Questions?