This article summarizes the 20 iOS filters are based on Gpuimage, 3 filters are included in the Gpuimage library, and 17 are the classic filters in Instagram, integrated into one project. Using Gpuimage can be very easy to create our own filter effects will always have the effect you want it. Under the article attached source download
I'm sure you're using the filter, too. The filter implementation is actually not a particularly difficult technique, attached below. Because the main implementation of several filters is a fragment coloring program, it will show
Amaro filter, implemented by the Fwamarofilter class. It's one of the classic filters in the Instagram app for any dark-toned photo
NSString *ConstKfwamaroshaderstring =shader_string (Precision lowpfloat; Varying HIGHP vec2 texturecoordinate; Uniform sampler2d inputimagetexture; Uniform sampler2d InputImageTexture2; //Blowout;Uniform sampler2d inputImageTexture3;//Overlay;Uniform sampler2d InputImageTexture4;//Map voidMain () {VEC4 Texel=texture2d (Inputimagetexture, texturecoordinate); VEC3 Bbtexel=texture2d (InputImageTexture2, texturecoordinate). RGB; TEXEL.R=texture2d (InputImageTexture3, VEC2 (BBTEXEL.R, TEXEL.R)). R; TEXEL.G=texture2d (InputImageTexture3, VEC2 (BBTEXEL.G, TEXEL.G)). G; TEXEL.B=texture2d (InputImageTexture3, VEC2 (bbtexel.b, texel.b)). b; VEC4 mapped; MAPPED.R= Texture2d (InputImageTexture4, VEC2 (TEXEL.R,.16666). R; MAPPED.G= Texture2d (InputImageTexture4, VEC2 (TEXEL.G,.5). G; MAPPED.B= Texture2d (InputImageTexture4, VEC2 (texel.b,.83333). b; MAPPED.A=1.0; Gl_fragcolor=mapped;} );
Amaro
Softelegance filter, implemented by Gpuimagesoftelegancefilter. Retro filter, feel like old on beach ~ ~ ~
Missetikate Filter
The Nashville filter, Nashville is one of the most stunning of Instagram's many filters, and the unique milkshake hue gives the photo a fairy-tale aesthetic feel. Scope of application: To create a romantic aesthetic feeling.
Lordkelvin filter.
Amatorka Filter
The rise filter allows the portrait skin to be well adjusted.
Hudson Filter.
XPROII Filter
1977 Filters
Valencia Filter
Walden Filter
Lomofi Filter
Inkwell Filter
Sierra Filter
Earlybird Filter
Sutro Filter
Toaster filter
Brannan Filter
Hefe Filter
Implementation of "Taking Fwnashvillefilter as an example"
Creating a filter class , I inherit all the filter classes from the Gpuimagefiltergroup class, which allows the classes we create to mix other filters. It is actually adding the required input texture image to the FWFilter1 class.
@interface fwnashvillefilter:gpuimagefiltergroup{ *imagesource;}
creates a filter effect that primarily implements the effect of a filter, including a fragment shader program. It is a concrete implementation of the filter effect
@interface Fwfilter1:gpuimagetwoinputfilter@end
Application
+ (UIImage *) Applynashvillefilter: (UIImage *) image{ *filter = [[Fwnashvillefilter alloc] init]; [Filter forceProcessingAtSize:image.size]; *pic = [[Gpuimagepicture alloc] initwithimage:image]; [pic Addtarget:filter]; [pic Processimage]; [Filter usenextframeforimagecapture]; return [Filter Imagefromcurrentframebuffer];}
Download the project
iOS 20 Cool Fashion Art Filter Summary "attached source"