An image compositing framework written in Swift.

Overview

Logo

Build Status CocoaPods

An asynchronous, multithreaded, image compositing framework written in Swift.

Installation

CocoaPods

Add Overlay to your Podfile:

pod 'OverlayComposite'

And run pod install

Usage

Quick Start

Creating Layers

Overlay works using the concept of layered images. Each layer represents an individual image that can then be added atop another layer. You can think of this like layers in Photoshop, or similar image editor.

For example, take the following model:

Layer 0

  • Layer 0: A large blue square
  • Layer 1: A medium orange triangle
  • Layer 2: A small green polygon

Technical Note: For this guide, we will assume that these images are named "Square", "Triangle", and "Polygon" in our app's Asset Catalog, and they are all formatted as PNG images with a transparent background.

A collection of images organized into layers is represented in code using the Layers class.

// Create a dictionary of all the images and layers we want to create.
// This will then be passed to Layers
let layerDictionary: [Int: String] =
[
  0: "Square",
  1: "Triangle",
  2: "Polygon"
]

// Create the new layers object.
guard let layers = try? Layers(named: layerDictionary) else {
  // Some error occurred
  return
}

Alternatively, you could create a dictionary using UIImage objects:

let layerDictionary: [Int: UIImage]

And pass it to Layers.init(with:)

Now we have a layered image represented in Swift!

Rendering Layers

Of course, we want to be able to use our new composite image. To do that we use OverlayRenderer

// Create a new renderer
let renderer = OverlayRenderer()

renderer.composite(from: layers) { result in
  // Here we can access the completed render
}

The result:

Result

To see this in action, check out the Sample App included in the source code.

Layer Operations

You can insert, append, and remove layers from a Layers object. See the Layers Guide

API Documentation

Contributing

Pull Requests

If you wish to contribute to Overlay, create a new branch, implement your feature or fix, and then submit a pull request.

Documentation

Generate documentation with Jazzy

You might also like...
A lightweight and fast image loader for iOS written in Swift.

ImageLoader ImageLoader is an instrument for asynchronous image loading written in Swift. It is a lightweight and fast image loader for iOS. Features

Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)
Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)

WDImagePicker Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with WDImagePicker. Just set your custom crop area a

A simple UIImageView extension for using initials as a profile image, written in swift
A simple UIImageView extension for using initials as a profile image, written in swift

InitialsImageView An easy, helpful UIImageView extension that generates letter initials as a placeholder for user profile images, with a randomized ba

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.

GPUImage 2 Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview GPUImage 2 is the second generation of th

GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.

GPUImage 3 Janie Clayton http://redqueengraphics.com @RedQueenCoder Brad Larson http://www.sunsetlakesoftware.com @bradlarson contact@sunsetlakesoftwa

A pure Swift high-performance asynchronous image loading framework. SwiftUI supported.
A pure Swift high-performance asynchronous image loading framework. SwiftUI supported.

Longinus Longinus is a pure-Swift high-performance asynchronous web image loading,caching,editing framework. It was learned from Objective-C web image

SwiftUI Image loading and Animation framework powered by SDWebImage
SwiftUI Image loading and Animation framework powered by SDWebImage

SDWebImageSwiftUI What's for SDWebImageSwiftUI is a SwiftUI image loading framework, which based on SDWebImage. It brings all your favorite features f

An open source iOS framework for GPU-based image and video processing
An open source iOS framework for GPU-based image and video processing

GPUImage Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview The GPUImage framework is a BSD-licensed iO

Asynchronous image loading framework.
Asynchronous image loading framework.

YYWebImage YYWebImage is an asynchronous image loading framework (a component of YYKit). It was created as an improved replacement for SDWebImage, PIN

Releases(1.0.1)
Owner
Aaron Sutton
CS @ Pitt. Brews coffee via HTCPCP
Aaron Sutton
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

Adnan Yousaf 11 Jan 10, 2022
๐Ÿ“ท A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
๐Ÿ“ท A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023
AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Dmytro Anokhin 1k Jan 4, 2023
A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

David Phillip Oster 2 Oct 28, 2022
Convert the image to hexadecimal to send the image to e-paper

ConvertImageToHex Convert the image to hexadecimal to send the image to e-paper Conversion Order // 0. hex๋กœ ๋ณ€ํ™˜ํ•  ์ด๋ฏธ์ง€ var image = UIImage(named: "sample

Hankyeol Park 0 Feb 26, 2022
Image-cropper - Image cropper for iOS

Image-cropper Example To run the example project, clone the repo, and run pod in

Song Vuthy 0 Jan 6, 2022
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

null 8 Dec 16, 2022
Agrume - ๐Ÿ‹ An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

Jan Gorman 601 Dec 26, 2022