Powered by Metal with AsyncGraphics
.package(url: "https://github.com/heestand-xyz/ImageFX", from: "2.0.0")
In version
2.0.0
spatial values are not relative anymore, they are absolute in pixel space
All examples work with
UIImage
andNSImage
let image: UIImage = UIImage(named: "Kite")!
let fxImage: UIImage = try await image.fxBlur(100)
let fxImage: UIImage = try await image.fxEdge()
let fxImage: UIImage = try await image.fxClamp(low: 0.25, high: 0.75)
let fxImage: UIImage = try await image.fxKaleidoscope()
let fxImage: UIImage = try await image.fxBrightness(2.0)
let fxImage: UIImage = try await image.fxGamma(0.5)
let fxImage: UIImage = try await image.fxInvert()
let fxImage: UIImage = try await image.fxOpacity(0.5)
let fxImage: UIImage = try await image.fxContrast(2.0)
let fxImage: UIImage = try await image.fxQuantize(0.125)
let fxImage: UIImage = try await image.fxSharpen(2.0)
let fxImage: UIImage = try await image.fxSlope()
let fxImage: UIImage = try await image.fxThreshold()
let fxImage: UIImage = try await image.fxSepia(color: .orange)
let fxImageA: UIImage = try await image.fxRange(inLow: 0.0, inHigh: 1.0, outLow: 0.0, outHigh: 0.5)
let fxImageA: UIImage = try await image.fxSaturation(0.5)
let fxImageB: UIImage = try await image.fxMonochrome()
let fxImage: UIImage = try await image.fxHue(.degrees(180))
import AsyncGraphics
let fxImage: UIImage = try await image
.fx { graphic in
let noise: Graphic = try await .coloredNoise(resolution: graphic.resolution)
return try await graphic.displaced(with: noise, offset: 100)
}