Skip to content
Image Effects
Swift Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swiftpm/xcode/package.xcworkspace
Assets
Sources/ImageFX
.gitignore
ImageFX.podspec
LICENSE
Package.resolved
Package.swift
Podfile
Podfile.lock
README.md

README.md

ImageFX

License Cocoapods Platform

Powered by Metal through PixelKit

Install

Swift Package

.package(url: "https://github.com/hexagons/ImageFX.git", from: "0.1.4")

Important when using the Swift Package, link the metal library by calling fxMetalLib(url:) in application didFinishLaunchingWithOptions in the AppDelegate, before using any effects:

#if os(iOS)
fxMetalLib(url: Bundle.main.url(forResource: "PixelKitShaders-iOS", withExtension: "metallib")!)
#elseif os(macOS)
fxMetalLib(url: URL(fileURLWithPath: "/path/to/PixelKitShaders-macOS.metallib"))
#endif

You can find the latest Metal library from PixelKit here.

Cocoapods

pod 'ImageFX', '~> 0.1.4'

Effects

Source image

Blur

let fxImage: UIImage = image.fxBlur(0.1)

Edge

let fxImage: UIImage = image.fxEdge()

Clamp

let fxImage: UIImage = image.fxClamp(low: 0.25, high: 0.75)

Kaleidoscope

let fxImage: UIImage = image.fxKaleidoscope()

Levels: Brightness

let fxImage: UIImage = image.fxBrightness(2.0)

Levels: Gamma

let fxImage: UIImage = image.fxGamma(0.5)

Levels: Invert

let fxImage: UIImage = image.fxInvert()

Levels: Opacity

let fxImage: UIImage = image.fxOpacity(0.5)

Levels: Contrast

let fxImage: UIImage = image.fxContrast(2.0)

Quantize

let fxImage: UIImage = image.fxQuantize(0.125)

Sharpen

let fxImage: UIImage = image.fxSharpen(2.0)

Slope

let fxImage: UIImage = image.fxSlope()

Threshold

let fxImage: UIImage = image.fxThreshold()

Twirl

let fxImage: UIImage = image.fxTwirl()

Transform

let fxImage: UIImage = image.

Sepia

let fxImage: UIImage = image.fxSepia(color: .orange)

Range

let fxImage: UIImage = image.fxRange(inLow: 0.0, inHigh: 1.0, outLow: 0.0, outHigh: 0.5)
let fxImage: UIImage = image.fxRange(inLow: .black, inHigh: .white, outLow: .black, outHigh: .gray)

Saturation

let fxImage: UIImage = image.fxSaturation(0.5)
let fxImage: UIImage = image.fxMonochrome()

Hue

let fxImage: UIImage = image.fxHue(0.5)
You can’t perform that action at this time.