GithubHelp home page GithubHelp logo

adamnemecek / pixels Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heestand-xyz/pixelkit

0.0 2.0 0.0 54.11 MB

a Live Graphics Framework for iOS

License: MIT License

Metal 33.83% Swift 66.17%

pixels's Introduction

Pixels

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.

Example 1

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

Example 2

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.

File IO

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.