a Live Graphics Framework for iOS
powered by Metal
Content: Camera, Image, Video, Color, Circle, Rectangle, Polygon, Gradient and Noise.
Effects: Levels, Blur, Edge, Threshold, Quantize, Kaleidoscope, Twirl, Feedback, ChannelMix, ChromaKey, Lookup, Cross, Blend and Blends.
More info in the Docs.
import Pixels
let camera = CameraPIX()
let levels = LevelsPIX()
levels.inPix = camera
levels.gamma = 2
levels.inverted = true
let blur = BlurPIX()
blur.inPix = levels
blur.radius = 100
let finalPix: PIX = blur
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)
Remeber to add NSCameraUsageDescription
to your info.plist
import Pixels
let cityImage = ImagePIX()
cityImage.image = UIImage(named: "city")
let supermanVideo = VideoPIX()
supermanVideo.load(fileNamed: "superman", withExtension: "mov")
let supermanKeyed = ChromaKeyPIX()
supermanKeyed.inPix = supermanVideo
supermanKeyed.keyColor = .green
let blend = BlendPIX()
blend.blendingMode = .over
blend.inPixA = cityImage
blend.inPixB = supermanKeyed
let finalPix: PIX = blend
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)
This is a representation of the Pixel Nodes Green Screen project.
You can find example files here.
import Pixels
let url = Bundle.main.url(forResource: "test", withExtension: "json")!
let json = try! String(contentsOf: url)
let project = try! Pixels.main.import(json: json)
let finalPix: PIX = project.pixs.last!
finalPix.view.frame = view.bounds
view.addSubview(finalPix.view)
To export just run Pixels.main.export()
once you've created your PIXs.
Note that exporting resourses like image and video are not yet supported.
Simulator not supported. Metal for iOS can only run on a physical iOS device.
Try out the effects in Pixel Nodes, a live graphics node editor for iPad, from which the core of Pixels was created.
by Anton Heestand, Hexagons.