Skip to content

A Image Processing test field of Apple Platform. Mainly using Swift and Metal

License

Notifications You must be signed in to change notification settings

xinhuang327/Filmroom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filmroom, an image process playground

Swift 4 + iOS 11 or macOS 10.13

Mainly working on iOS

Importance Notice

This repository is going to update to become runnable on Swift 5 & iOS 13, due to the author intent to hunt a job for iOS development :D

iOS Part include

  • Exposure
  • Shadow & highlight
  • Saturation
  • Contrast
  • HSL for Orange
  • The implementation of Low Light Enhancement Algorithm - LIME

Rendering Features

  • Real-Time Rendering via MTKView
    • Adapted aspect radio
    • Lowest CPU cost with fewest data type conversion
    • This way is much more faster than DispatchQueue method.
  • Argument Buffer of Metal, which decrease around 10 times of CPU overheads. (macOS only)

macOS parts included

  • Gamma Correction
  • Gaussian Blur
  • Transforms between NSImage, CIImage and CGImage.

Computation Kernels

  • 2D FFT in Apple Metal by a Iterative Way
  • Illumination Map in mean way
  • Shrinkage
  • Gradient
  • Low Light Enhancement Algorithm - LIME

Kernel codes

Core Image kernels locate in CustomKernel functions from CustomFilter.swift, you can also find them in Kernels.cikernel for Core Image Kernel with comments under the iOS directory.

The filter written in Metel is located in here.

Computational Kernel can be found both in macOS project and iOS project. These two kernels are not identical, please focus on iOS one.

Test

Thanks to Core Image, you can test these filters by images supported by it. Output is available.

FFT Result

Case 1:

FFTcase1

Case 2: FFTcase2

Low-Light Image Enhancement (LIME)

Reference of LIME

Guo, X., Li, Y., & Ling, H. (2017). LIME: Low-Light Image Enhancement via Illumination Map Estimation. IEEE TRANSACTIONS ON IMAGE PROCESSING, 26(2), 982–993.

Result

LIMEcase1

LIMEcase2

About

A Image Processing test field of Apple Platform. Mainly using Swift and Metal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 80.2%
  • Metal 19.8%