{"id":1521,"url":"https://github.com/aaronjsutton/OverlayComposite","last_synced_at":"2025-08-02T04:31:20.769Z","repository":{"id":62449749,"uuid":"111925146","full_name":"aaronjsutton/OverlayComposite","owner":"aaronjsutton","description":"An image compositing framework written in Swift.","archived":false,"fork":false,"pushed_at":"2017-12-05T06:53:30.000Z","size":8739,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T03:16:06.223Z","etag":null,"topics":["framework","image-processing","ios","swift","swift-library","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronjsutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-24T14:08:52.000Z","updated_at":"2023-07-18T12:11:35.000Z","dependencies_parsed_at":"2022-11-01T23:30:32.643Z","dependency_job_id":null,"html_url":"https://github.com/aaronjsutton/OverlayComposite","commit_stats":null,"previous_names":["aaronjsutton/overlay"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aaronjsutton/OverlayComposite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjsutton%2FOverlayComposite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjsutton%2FOverlayComposite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjsutton%2FOverlayComposite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjsutton%2FOverlayComposite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronjsutton","download_url":"https://codeload.github.com/aaronjsutton/OverlayComposite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronjsutton%2FOverlayComposite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334611,"owners_count":24233793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","image-processing","ios","swift","swift-library","swift4"],"created_at":"2024-01-05T20:15:48.421Z","updated_at":"2025-08-02T04:31:20.361Z","avatar_url":"https://github.com/aaronjsutton.png","language":"Swift","funding_links":[],"categories":["Media"],"sub_categories":["Image","Other free courses"],"readme":"![Logo](https://docs.aaronjsutton.com/overlay/img/logo.png)\n\n[![Build Status](https://travis-ci.org/aaronjsutton/OverlayComposite.svg?branch=master)](https://travis-ci.org/aaronjsutton/OverlayComposite)\n[![CocoaPods](https://img.shields.io/cocoapods/v/OverlayComposite.svg)]()\n\n\nAn asynchronous, multithreaded, image compositing framework written in Swift.\n\n## Installation\n\n### [CocoaPods](http://cocoapods.org)\n\nAdd Overlay to your Podfile:\n\n```ruby\npod 'OverlayComposite'\n```\n\nAnd run `pod install`\n\n## Usage\n\n### Quick Start\n\n#### Creating Layers\n\nOverlay 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.\n\nFor example, take the following model:\n\n![Layer 0](https://docs.aaronjsutton.com/overlay/img/example.png)\n\n- Layer 0: A large blue square\n- Layer 1: A medium orange triangle\n- Layer 2: A small green polygon\n\n_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.\n\nA collection of images organized into layers is represented in code using the `Layers` class.\n\n```swift\n// Create a dictionary of all the images and layers we want to create.\n// This will then be passed to Layers\nlet layerDictionary: [Int: String] =\n[\n  0: \"Square\",\n  1: \"Triangle\",\n  2: \"Polygon\"\n]\n\n// Create the new layers object.\nguard let layers = try? Layers(named: layerDictionary) else {\n  // Some error occurred\n  return\n}\n```\n\nAlternatively, you could create a dictionary using UIImage objects:\n```swift\nlet layerDictionary: [Int: UIImage]\n```\nAnd pass it to `Layers.init(with:)`\n\n_Now we have a layered image represented in Swift!_\n\n#### Rendering Layers\n\nOf course, we want to be able to use our new composite image. To do that we use `OverlayRenderer`\n\n```swift\n// Create a new renderer\nlet renderer = OverlayRenderer()\n\nrenderer.composite(from: layers) { result in\n  // Here we can access the completed render\n}\n```\n\nThe result:\n\n![Result](https://docs.aaronjsutton.com/overlay/img/result.png)\n\nTo see this in action, check out the Sample App included in the source code.\n\n#### Layer Operations\n\nYou can insert, append, and remove layers from a `Layers` object.\nSee the [Layers Guide](https://docs.aaronjsutton.com/overlay/Classes/Layers.html)\n\n### [API Documentation](https://docs.aaronjsutton.com/overlay/)\n\n## Contributing\n\n#### Pull Requests\n\nIf you wish to contribute to Overlay, create a new branch, implement your feature or fix, and then submit a pull request.\n\n#### Documentation\n\nGenerate documentation with [Jazzy](https://github.com/realm/jazzy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronjsutton%2FOverlayComposite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronjsutton%2FOverlayComposite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronjsutton%2FOverlayComposite/lists"}