IOS濾鏡

IOS 自帶coreImage CIFilter 共有100多種濾鏡效果,官方只介紹了一種,找不到中文介紹,下面是其中一部分中文介紹html

 CIAdditionCompositing     //影像合成chrome

    CIAffineTransform           //仿射變換orm

    CICheckerboardGenerator       //棋盤發生器htm

    CIColorBlendMode              //CIColor混合模式blog

    CIColorBurnBlendMode          //CIColor燃燒混合模式圖片

    CIColorControls ip

    CIColorCube                   //立方體input

    CIColorDodgeBlendMode         //CIColor避免混合模式it

    CIColorInvert                 //CIColor反相io

    CIColorMatrix                 //CIColor矩陣

    CIColorMonochrome             //黑白照

    CIConstantColorGenerator      //恆定顏色發生器

    CICrop                        //裁剪

    CIDarkenBlendMode             //亮度混合模式

    CIDifferenceBlendMode         //差分混合模式

    CIExclusionBlendMode          //互斥混合模式

    CIExposureAdjust              //曝光調節

    CIFalseColor                  //僞造顏色

    CIGammaAdjust                 //灰度係數調節

    CIGaussianGradient            //高斯梯度

    CIHardLightBlendMode          //強光混合模式

    CIHighlightShadowAdjust       //高亮陰影調節

    CIHueAdjust                   //飽和度調節

    CIHueBlendMode                //飽和度混合模式

    CILightenBlendMode            

    CILinearGradient              //線性梯度

    CILuminosityBlendMode         //亮度混合模式

    CIMaximumCompositing          //最大合成

    CIMinimumCompositing          //最小合成

    CIMultiplyBlendMode           //多層混合模式

    CIMultiplyCompositing         //多層合成

    CIOverlayBlendMode            //覆蓋疊加混合模式

    CIRadialGradient              //半徑梯度

    CISaturationBlendMode         //飽和度混合模式

    CIScreenBlendMode             //全屏混合模式

    CISepiaTone                   //棕黑色調

    CISoftLightBlendMode          //弱光混合模式

    CISourceAtopCompositing       

    CISourceInCompositing 

    CISourceOutCompositing 

    CISourceOverCompositing 

    CIStraightenFilter            //拉直過濾器

    CIStripesGenerator            //條紋發生器

    CITemperatureAndTint          //色溫

    CIToneCurve                   //色調曲線

    CIVibrance                    //振動

    CIVignette                    //印花

    CIWhitePointAdjust            //白平衡調節

 

下面是一個圖片作舊 灰白濾鏡效果

 NSString *filePath =
        [[NSBundle mainBundle] pathForResource:@"tp02" ofType:@"png"];
        NSURL *fileNameAndPath = [NSURL fileURLWithPath:filePath];
        
        // 2
        CIImage *beginImage =
        [CIImage imageWithContentsOfURL:fileNameAndPath];
        
        CIFilter *filter = [CIFilter filterWithName:@"CIColorMonochrome"
                            
                                      keysAndValues:kCIInputImageKey,beginImage,kCIInputColorKey,[CIColor colorWithCGColor:[UIColor lightGrayColor].CGColor],nil];
        
        NSLog(@"%@",filter.attributes);
        // 3 CIColor
//        CIFilter *filter = [CIFilter filterWithName:@"CISepiaTone"
//                                      keysAndValues: kCIInputImageKey, beginImage,
//                            @"inputIntensity", @0.99999, nil];
        CIImage *outputImage = [filter outputImage];
//
//        // 4
        UIImage *newImage = [UIImage imageWithCIImage:outputImage];
        cell.photo.image =newImage;

 還有一種使用RGBA通道的位圖上下文重畫像素點的方法 給個連接

http://blog.sina.com.cn/s/blog_6f29e81f010176lr.html

相關文章
相關標籤/搜索