//1. Original imageUIImage * image = [UIImage imagenamed:@"1.jpg"]; /****************core image******************/ //A. PictureCiimage * Ciimage =[[Ciimage alloc] initwithimage:image]; //B. FiltersCifilter * Cifilter = [Cifilter filterwithname:@"Cigaussianblur"]; NSLog (@"%@", [Cifilter attributes]); //sets the blur level of the filter by default[Cifilter setvalue:@ (Ten) Forkey:@"Inputradius"]; //put a picture in a filter[Cifilter setvalue:ciimage Forkey:kciinputimagekey]; //Output PictureCiimage * Outimage =[Cifilter Valueforkey:kcioutputimagekey]; //C. Getting a handle to a cgimageCicontext * Context =[Cicontext Contextwithoptions:nil]; Cgimageref Outcgimage=[Context Createcgimage:outimage fromrect:[outimage extent]; UIImage* Blurimage =[UIImage Imagewithcgimage:outcgimage]; Cgimagerelease (Outcgimage); /********************************************/ //2. Initialize ImageViewUiimageview * ImageView = [[Uiimageview alloc] Initwithframe:cgrectmake (0, -, the, $)]; Imageview.image=Blurimage; [Self.view Addsubview:imageview];
Coreimage's blur filter