Latest 0.1.0
Homepage https://github.com/martinpilch/MMMFilterKit
License MIT
Platforms ios 8.0
Authors

[![CI Status](http://img.shields.io/travis/Martin Pilch/MMMFilterKit.svg?style=flat)](https://travis-ci.org/Martin Pilch/MMMFilterKit)
Version
License
Platform

MMMFilterKit simplify usage of CIFilter to just few lines of code. You can simply chain them, create your own and perform them on EAGLContext.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

MMMFilterKit is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'MMMFilterKit'

Note that you’ll also need to add use_frameworks! to your Podfile if you haven’t already.

Author

Martin Pilch, [email protected]

License

MMMFilterKit is available under the MIT license. See the LICENSE file for more info.

Usage

You can simply get processed image by passing CIImage to any of built-in filters.

let outImg = SharpenFilters.SharpenLuminance(0.5)(inImg)

Chaining

Filters can be chained together using the |> operator.

let randomFilter = GeneratorFilters.RandomGenerator()
let contrastFilter = ColorAdjustmentFilters.ColorControls(saturation: 0, brightness: 0, contrast: 1)
let colorFilter = ColorAdjustmentFilters.ColorMatrix(red: 0.2, green: 0.2, blue: 0.2, alpha: 0.5)
let filters = randomFilter |> contrastFilter |> colorFilter
let outImg = filters(inImg)

Processing using EAGLContext

If you need to execute filters fast, you can use ImageProcessing class to do it using EAGLContext.

let filterExposure = ColorAdjustmentFilters.ExposureAdjust(exposure: exposure)
let filterSharpen = SharpenFilters.SharpenLuminance(sharpness: sharpen)

let filters: [Filter] = [filterExposure, filterSharpen]
ImageProcessing.sharedInstance.processImage(image: image, filters: filters) { [weak self] (outputImage) in
    self?.imageView?.image = outputImage
}

Thanks

Inspired by the "CIFilterKit" by Jeff Blagdon.

Latest podspec

{
    "name": "MMMFilterKit",
    "version": "0.1.0",
    "summary": "MMMFilterKit is simple wrapper in Swift for CIFilter.",
    "description": "MMMFilterKit will simplify usage of CIFilter for you.nIt allows chaining, creating custom filters and fast processing using EAGL context.nInspired by great CIFilterKit!",
    "homepage": "https://github.com/martinpilch/MMMFilterKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Martin Pilch": "[email protected]"
    },
    "source": {
        "git": "https://github.com/martinpilch/MMMFilterKit.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MMMFilterKit/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This