20 categories of iOS fashion art filters [Source Code] and 20 categories of ios
This article summarizes that 20 ios filters are based on GPUImage. There are 3 filters included in the GPUImage library, and 17 are classic filters in Instagram, which are integrated into a project. With GPUImage, it is very easy to create our own filter effects. There will always be what you want. Download the source code below the article
I believe you are also using filters. Today, we will show you that filter implementation is not a particularly difficult technology. Here are some of the following. As the main implementation of several filters is a segment coloring program, it will be displayed.
The Amaro filter is implemented through the FWAmaroFilter class. It is one of the classic filters in the Instagram app and is applicable to pictures with dark tones.
NSString * const inline = SHADER_STRING (precision lowp float; varying highp vec2 inline; uniform sampler2D inline; uniform sampler2D inline; // blowout; uniform inline; // overlay; uniform partial handle; // map void main () {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
The SoftElegance filter is implemented through GPUImageSoftEleganceFilter. The retro filter feels like the old one on the beach ~~~
MissEtikate Filter
Nashville filter, Nashville is one of the most amazing among Instagram's many filters. The unique milkshake color gives the photos a fairy tale look. Applicability: Create a romantic and beautiful feeling.
LordKelvin filter.
Amatorka Filter
The Rise filter can be used to adjust the skin of a portrait.
Hudson filter.
XproII Filter
1977 Filter
Valencia Filter
Walden Filter
Lomofi Filter
Inkwell Filter
Siider Filter
Earlybird Filter
Sutro Filter
Toaster Filter
Brannan Filter
Hefe Filter
Implementation [take FWNashvilleFilter as an example]
Create a filter class. I inherit all the filter classes from the GPUImageFilterGroup class, which allows the class we created to mix other filters. It actually adds the required input texture image to the FWFilter1 class.
@interface FWNashvilleFilter : GPUImageFilterGroup{ GPUImagePicture *imageSource ;}
Create a filter effect, which mainly implements the filter effect, including a clip coloring program. It is the specific implementation of the filter effect.
@interface FWFilter1 : GPUImageTwoInputFilter@end
Application
+ (UIImage *)applyNashvilleFilter:(UIImage *)image{ FWNashvilleFilter *filter = [[FWNashvilleFilter alloc] init]; [filter forceProcessingAtSize:image.size]; GPUImagePicture *pic = [[GPUImagePicture alloc] initWithImage:image]; [pic addTarget:filter]; [pic processImage]; [filter useNextFrameForImageCapture]; return [filter imageFromCurrentFramebuffer];}
Download Project