Skip to content

iOS Photo App with sticker and template masking features

Notifications You must be signed in to change notification settings

highjump0615/PhotoMaskApp

Repository files navigation

Photo Mask iOS App

iOS Photo App with template image and stickers

Overview

1. Main Features

  • Photo masking with template images
  • Adding Stickers to image
  • Extract human face from any photo or image
  • Save image to disk

2. Techniques

Main language: Swift 4.0

2.1 UI Implementation

  • Variable font size on different screen
    Different font size based on size classes
  • Stack View
    • Activate page
  • Padding on UITextField in Activate page
  • Material clickable background
    • Adding view on text field programatically

2.2 Function Implementation

  • Dealing with multiple gestures for background image and sticker & touch-ignored view
    Implementing UIGestureRecognizerDelegate method to filter touched views
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
    // touched sticker view, cancel this gesture
    if touch.view is CHTStickerView {
        hideStickerEditFrame()
        
        // show edit frame
        let stickerView = touch.view as! CHTStickerView
        stickerView.showEditingHandlers = true
        
        return false
    }
    // touched unnecessary view, cancel this gesture
    if touch.view!.isDescendant(of: self.panelView) {
        return false
    }

    // allow this gesture
    return true
}
  • Implemented Activation logic with Firebase
    UUID is the key for each phone, added some more user info on that key
  • Hand-drawing for marking face area
    • Drawing as image using Image Context with touched points
      UIGraphicsBeginImageContext()
      UIGraphicsGetImageFromCurrentImageContext()
      UIGraphicsEndImageContext()
  • Save/Load data to UserDefaults
    • Activation flag for determining status when opens app
  • Face extrating module
    ./Lib/imagemat
    • Using SSE2NEON.h for ARM Architecture (iOS devices, not simulator)

2.2.3 Third-Party Libraries

Need to Improve

  • Improve face extraction speed, etc

About

iOS Photo App with sticker and template masking features

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published