In this tutorial, we will see about Core Image & how to apply different image filters. We will also see how to apply different filters and cool effects to images in realtime.
Some of the most important calsses of Core Image framework are
CIContext: All Core Image processing is done in a CIContext
CIImage: It holes the image data.
CIFilter: There is a dictionary of ilter class which defines the attributes of the particular filter like vibrance filters, cropping filters, color inversion filters and much more.
Some basic steps to setup the project and getting started
- Create an iOS project from your Xcode with single view application.
- Add the CoreImage.framework in the project.
- Add one sample image in the resources folder and include in the project.
- As the application is single view application, there will be a ViewController class in the application. Add one UIImageView in ViewController.xib file and connect with the UIImageview object defined in your interface class.
Basic Image Filtering
Lets see an example by simply running an image through a CIFilter and displaying it on the screen. We need to do following four things every time whenever we want to a apply a SIFilters to an image.
Using filters on CoreImage Framework in iOS, which bring out the vibrancy or exposure of each photo. While using multiple filters for a single image, or the filters can be grouped to create one combustion of a single filter.