1.
UIImage *imag = [UIImage imagenamed:@ "img"];
/* --------------------use coreimg---------------------------* /
//Ciimage
ciimage *ciimg = [[ciimage alloc] initwithimage: imag];
//Cifilter
cifilter *blurfilter = [cifilter filterwithname:@ "Cigaussianblur"];
// can output the degree of blur of the setting
NSLog(@ "%@", [blurfilter attributes]);
// You can set the degree of blur based on the previous step
[Blurfilter setValue:@ (forkey) :@ "Inputradius"];
// image input Filter
[Blurfilter setValue: ciimg forkey:kciinputimagekey];
// push-piece output
ciimage *outputimg = [Blurfilter valueforkey:kcioutputimagekey];
//Cicontext
Cicontext * context = [cicontext contextwithoptions:nil];
// get cgimage handle
cgimageref outimgref = [Context createcgimage: outputimg fromrect: [outputimg extent]] ;
//h get to the last picture
UIImage *blurimg = [UIImage imagewithcgimage: outimgref];
// release handle
cgimagerelease(outimgref);
Finally get the blurred picture blurimg
The second Kind
/* ___________________ Uiimage+imageeffects.h ________________________________ */
UIImage *sourimg = [UIImage imagenamed:@ "img"];
UIImage *blurimg = [sourimg Blurimagewithradius:];
Third Kind Uivisualeffectview
uiscrollview *SC = [[ uiscrollview alloc Initwithframe:self. View. Bounds
uiimageview *imgview = [[uiimageview alloc] initwithframe:cgrectmake( 0, 0, + )];
Imgview. image = imag;
[SC addsubview: Imgview];
SC.contentsize = Imgview. Bounds. Size;
[self. View addsubview: sc];
uivisualeffectview *effectview = [[uivisualeffectview alloc] initwitheffect: [ Uiblureffect effectwithstyle:uiblureffectstyleextralight]];
Effectview. frame = cgrectmake(0, N, + );
[self. View addsubview: Effectview];
UILabel *lable = [[UILabel alloc] initwithframe: Effectview. Bounds];
Lable. text = @ " blurred background ";
Lable. font = [uifont systemfontofsize:];
Lable. textalignment = nstextalignmentcenter;
// Add Fuzzy sub effictview using --uivibrancyeffect and need to be consistent with the parent class
uivisualeffectview *subeffectview = [[uivisualeffectview alloc] initwitheffect: [ Uivibrancyeffect effectforblureffect:(uiblureffect *) Effectview. Effect]];
Subeffectview. frame = Effectview. Bounds;
// Add sub-blurred View to effectview contenctview to be effective
[Effectview. contentview addsubview: Subeffectview];
[Subeffectview. contentview addsubview: lable];
IOS Image obfuscation------Direct code copy is available for tagging