Skip to content
πŸŽ¨πŸ–Ό An image editor and engine using CoreImage
Branch: master
Clone or download
Latest commit 371e16e Mar 30, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
From Fil πŸš€ Init Oct 29, 2018
LUTViewer.playground [ImgBot] Optimize images Nov 5, 2018
Pixel.xcodeproj Swift 5.0 Mar 30, 2019
Pixel.xcworkspace Update Project Settings Oct 30, 2018
Resize.playground [ImgBot] Optimize images Nov 5, 2018
Resources Fix icon and demo app Oct 30, 2018
Sources Add current to Options Jan 23, 2019
.swift-version Swift 5.0 Mar 30, 2019 Update Mar 30, 2019
LICENSE πŸš€ Init Oct 29, 2018
Makefile Fix icon and demo app Oct 30, 2018
PixelEditor.podspec Update Mar 30, 2019
Podfile Cleanup Oct 29, 2018
customize.png [ImgBot] Optimize images Nov 5, 2018
neutral-lut.png πŸš€ Init Oct 29, 2018
preview.gif Add gif Oct 30, 2018
sample1.png [ImgBot] Optimize images Nov 5, 2018
sample2.png [ImgBot] Optimize images Nov 5, 2018
sample3.png [ImgBot] Optimize images Nov 5, 2018

Pixel - Engine β€’ Editor

CocoaPods FOSSA Status Engine

CocoaPods Editor

Image editor and engine using CoreImage

⚠️ Currently, API is not stable. It may change in the future.


Currently accepting PRs that impement these features.


  • ✈️Pretty Good
  • πŸš€Blazing Fast (πŸŒ€Anyone help us!)


  • Crop
  • Straighten (πŸŒ€Anyone help us!)
  • Perspective (πŸŒ€Anyone help us!)



  • ColorCube (Look Up Table)
    • Intensity

⚠️ Currently, Pixel does not contain LUT. Demo app has sample LUTs.

And also, here is interesting article


  • Brightness
  • Contrast
  • Saturation
  • Highlights
  • Shadows
  • Temperature
  • GaussianBlur
  • Vignette
  • Color (Shadows / Highlights)
  • Fade
  • Sharpen
  • Clarity
  • HLS (πŸŒ€Anyone help us!)



  • Swift 4.2 (Xcode10+)
  • iOS 10+

Getting Started contains the sample code. Please check out Sources/Demo/EditorViewController.swift.

Create instance of PixelEditViewController

let image: UIImage

let controller = PixelEditViewController(image: image)


  • as Modal

⚠️ Currently We need to wrap the controller with UINavigationController. Because, PixelEditViewController needs UINavigationBar.

let controller: PixelEditViewController

let navigationController = UINavigationController(rootViewController: controller)

self.present(navigationController, animated: true, completion: nil)
  • as Push

We can push the controller in UINavigationController.

let controller: PixelEditViewController
self.navigationController.push(controller, animated: true)

Setup Delegate

PixelEditViewController has delegate protocol called PixelEditViewControllerDelegate.

public protocol PixelEditViewControllerDelegate : class {
  func pixelEditViewController(_ controller: PixelEditViewController, didEndEditing editingStack: SquareEditingStack)
  func pixelEditViewControllerDidCancelEditing(in controller: PixelEditViewController)

πŸ’‘PixelEditViewController does not know how to dismiss or pop by itself. So we need to control PixelEditViewController outside.

Basically, it's like following code, recommend dismiss or pop in methods of delegate.

extension EditorViewController : PixelEditViewControllerDelegate {

  func pixelEditViewController(_ controller: PixelEditViewController, didEndEditing editingStack: SquareEditingStack) {

    self.navigationController?.popToViewController(self, animated: true)

  func pixelEditViewControllerDidCancelEditing(in controller: PixelEditViewController) {
    self.navigationController?.popToViewController(self, animated: true)


Render Image

let editingStack: SquareEditingStack

let image = editingStack.makeRenderer().render(resolution: .full)

Restore editing

We can take current editing as instance of EditingStack from PixelEditViewController.editingStack.

If we want to restore editing after closed PixelEditViewController, we use this.

let editingStack = controller.editingStack
// close editor

// and then when show editor again
let controller = PixelEditViewController(editingStack: editingStack)

Add ColorCubeFilters

We can use LUT(LookUpTable) with CIColorCubeFilter.

LUT is like this (Dimension is 64)

import PixelEngine

let lutImage: UIImage

let filter = FilterColorCube(
  name: "Filter Name",
  identifier: "Filter Identifier",
  lutImage: lutImage,
  dimension: 64

let storage = ColorCubeStorage(filters: [filter])
let controller = PixelEditViewController(image: image, colorCubeStorage: storage)

And also, if we don't specify colorCubeStorage, use default.

// set
ColorCubeStorage.default.filters = filters

// get

Customize Control-UI

We can customize UI for control area.

Customize Built-In Control-UI using override

There is Options struct in PixelEditor. We can create options that fit our usecases.

So, If we need to change ExposureControl, override ExposureControlBase class. Then set that class to Options.

let options = Options.default()
options.classes.control.brightnessControl = MyExposureControl.self

It's like using custom Cell in UICollectionView. If you have any better idea for this, please tell usπŸ’‘. And also Built-In UI may need expose some properties to customize from subclassing.

Customize whole Control-UI

We can also customize whole UI.

Override options.classes.control.rootControl, then build UI from scratch.


Strings in UI can be localized with L10n.

import PixelEditor

PixelEditor.L10n.done = "保存"

// or
PixelEditor.L10n.done = NSLocalizedString...



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

pod 'PixelEngine'
pod 'PixelEditor'


For Carthage, add the following to your Cartfile:

github "muukii/Pixel"


If you need more features, please open issue or submit PR! Muukii may not know the approach to take for implementing them, So your PR will be very helpful.


To develop Pixel, setup environment of development with following code.

$ pod install
$ open Pixel.xcworkspace


Muukii (


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

FOSSA Status

You can’t perform that action at this time.