{"id":1505,"url":"https://github.com/TinyCrayon/TinyCrayon-iOS-SDK","last_synced_at":"2025-08-06T13:32:58.548Z","repository":{"id":47112868,"uuid":"82016402","full_name":"TinyCrayon/TinyCrayon-iOS-SDK","owner":"TinyCrayon","description":"A smart and easy-to-use image masking and cutout SDK for mobile apps.","archived":false,"fork":false,"pushed_at":"2021-10-17T14:01:45.000Z","size":17135,"stargazers_count":1828,"open_issues_count":26,"forks_count":155,"subscribers_count":52,"default_branch":"master","last_synced_at":"2024-08-18T16:36:00.944Z","etag":null,"topics":["cutout","image-mask","image-processing","ios-sdk","mask-image"],"latest_commit_sha":null,"homepage":"https://www.tinycrayon.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TinyCrayon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-15T03:28:34.000Z","updated_at":"2024-08-05T09:39:55.000Z","dependencies_parsed_at":"2022-08-29T00:52:11.396Z","dependency_job_id":null,"html_url":"https://github.com/TinyCrayon/TinyCrayon-iOS-SDK","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TinyCrayon%2FTinyCrayon-iOS-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TinyCrayon%2FTinyCrayon-iOS-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TinyCrayon%2FTinyCrayon-iOS-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TinyCrayon%2FTinyCrayon-iOS-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TinyCrayon","download_url":"https://codeload.github.com/TinyCrayon/TinyCrayon-iOS-SDK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905520,"owners_count":17989779,"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","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":["cutout","image-mask","image-processing","ios-sdk","mask-image"],"created_at":"2024-01-05T20:15:48.030Z","updated_at":"2024-12-09T14:31:06.057Z","avatar_url":"https://github.com/TinyCrayon.png","language":"Swift","funding_links":[],"categories":["Media","Libs","Swift","Images [🔝](#readme)"],"sub_categories":["Image","Images","Other free courses"],"readme":"# TinyCrayon SDK for iOS\n\u003e A smart and easy-to-use image masking and cutout SDK for mobile apps.\n\n[![platform](https://img.shields.io/cocoapods/p/TinyCrayon.svg)](https://cocoapods.org/pods/TinyCrayon)\n[![Compatible](https://img.shields.io/badge/compatible-Swift%20%2F%20Objective--C%20-yellow.svg)](https://cocoapods.org/pods/TinyCrayon)\n[![CocoaPods](https://img.shields.io/cocoapods/v/TinyCrayon.svg)](https://cocoapods.org/pods/TinyCrayon)\n[![Documentation](https://img.shields.io/badge/docs-latest-green.svg)](https://www.tinycrayon.com/docs-iOS/index.html)\n[![App Store](https://img.shields.io/badge/app%20store-sample%20apps-orange.svg)](https://itunes.apple.com/developer/yongyun-zeng/id1071044410)\n[![license](https://img.shields.io/cocoapods/l/TinyCrayon.svg)](https://github.com/TinyCrayon/TinyCrayon-iOS-SDK/blob/master/LICENSE)\n\nTinyCrayon SDK provides tools for adding image cutout and layer mask capabilities to your mobile applications.\n\n![Quick Select Tool](https://cloud.githubusercontent.com/assets/4088232/23604872/7248944e-0295-11e7-83dc-002b267789d1.gif) | ![Hair Brush Tool](https://cloud.githubusercontent.com/assets/4088232/23604871/6f0c390c-0295-11e7-979d-f4824d839931.gif)\n------------ | -------------\nQuick Select Tool | Hair Brush Tool\n\n\n## Table of Contents\n\n* [Overview](#overview)\n* [Features](#features)\n* [Installation](#installation)\n   * [Prerequisites](#prerequisites)\n   * [Streamlined, using CocoaPods](#streamlined-using-cocoapods)\n   * [Manually, using the SDK download](#manually-using-the-sdk-download)\n      * [Download the SDK](#download-the-sdk)\n      * [Add the framework](#add-the-framework)\n   * [Settings for Objective-C](#settings-for-objective-c)\n* [Usage](#usage)\n   * [Add a TCMaskView](#add-a-tcmaskview)\n   * [TCMask class](#tcmask-class)\n* [Further reading](#further-reading)\n* [License](#license)\n* [Terms of use](#terms-of-use)\n\n## Overview\nTinyCrayon SDK provides tools for adding image cutout and layer mask capabilities to your mobile applications.\n\nImage layer mask is a fundamental technique in image manipulations. It allows you to selectively modify the opacity (transparency) of the layer they belong to. This flexibility to define the opacity of different areas of a layer is the basis for more interesting image manipulation techniques such as selective coloring and luminosity masking.\n\nThe current version of TinyCrayon SDK provides the following three tools:\n* Quick Select: Smart and easy to use, users just need to select part of the object and the edge detection algorithm will find the boundary.\n* Hair Brush: Smooth and natual looking, paint on the hair/fur of an object and the algorithm will select the hair/fur for you in high quality.\n* Regular Brush: A regular brush tool with the capability to adjust its size, hardness and opacity.\n\n\n## Features\n* Free: TinyCrayon SDK is provided under MIT license, you can use it in your commercial applications for free!\n* iPad support: TinyCrayon SDK uses auto layout for its views and adapts to each screen size - iPhone or iPad.\n* Highly customizable: Style the UI, view modes and localized languages as you wish.\n* Swift: Keeping up with time, we chose Swift as the main development language of the TinyCrayon SDK, leading to leaner easier code.\n* Objective-C support: All of our public API is Objective-C compatible.\n\n![create as many effects as you can think of](https://cloud.githubusercontent.com/assets/4088232/24956166/ffc4285c-1fb8-11e7-9743-209de801e31a.jpg)\n\n## Installation\n\n### Prerequisites\n* Xcode 9.0 or later.\n* A physical iOS device.\n\n### Steps\n1. Git clone this repo\n2. Download [OpenCV2](https://opencv.org/releases/) for iOS pack\n3. Unzip opencv-xxx.zip, move *opencv2.framework* to TCCore folder\n4. Open your project, drag *TinyCrayon.xcodeproj* to your workspace, then add *TCMask* to *Frameworks, Libraries, and Embeded Content* in your target-\u003eGeneral settings\n\n### Settings for Objective-C\n\nIf your project is using Objective-C, set `Always Embed Swift Standard Libraries` to be YES in your Build Settings.\n\n## Usage\n\n### Add a TCMaskView\n\nThe `TCMaskView` class is responsible to create a `UIViewController` for the user to mask the image.\nTo present a `TCMaskView`:\n\n*Swift*\n```\nlet maskView = TCMaskView(image: image)\nmaskView.delegate = self\nmaskView.presentFrom(rootViewController: self, animated: true)\n```\n*Objective-C*\n```\nTCMaskView *maskView = [[TCMaskView alloc] initWithImage:image];\nmaskView.delegate = self;\n[maskView presentFromRootViewController:self animated:true];\n```\n\nThe delegate of the `TCMaskView` can be used to be notified when the user cancels or completes the edit. In last case the function `tcMaskViewDidComplete(mask:image:)` is called. \n\n### TCMask class\n\n`TCMask` is provided by `TCMaskViewDelegate` functions as the first parameter when the user cancels or completes the edit. For example, when the user completes the edit with `TCMaskView`:\n\n*swift*\n```\nfunc tcMaskViewDidComplete(mask: TCMask, image: UIImage) {}\n```\n*Objective-C*\n```\n- (void)tcMaskViewDidCompleteWithMask:(TCMask *)mask image:(UIImage *)image {}\n```\n\n`TCMask` is an encapsulation of image masking result from `TCMaskView`, it has the following properties:\n\n* data: An array of 8-bits unsigned char, its length is equal to the number of pixels of the image in `TCMaskView`. Each element in data represents the mask value.\n* size: The size of mask, which is equal to the size of the image in `TCMaskView`.\n\n`TCMask` also provides some simple and easy to use functions to process layer mask with image. For example, to cutout an object:\n\n*Swift*\n```\nlet outputImage = mask.cutout(image: image, resize: false)\n```\n*Objective-C*\n```\nUIImage *outputImage = [mask cutoutWithImage:image resize:false];\n```\n\nTo try these examples, and find out about more options please take a look at the [Examples](https://github.com/TinyCrayon/TinyCrayon-iOS-SDK/releases).\n\n## Further reading\n* Check out TinyCrayon [guides](https://tinycrayon.github.io/TinyCrayon-iOS-SDK/guides-iOS/get-started.html) and [API reference](https://tinycrayon.github.io/TinyCrayon-iOS-SDK/docs-iOS/index.html) for more details.\n\n## License\nThe MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTinyCrayon%2FTinyCrayon-iOS-SDK","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTinyCrayon%2FTinyCrayon-iOS-SDK","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTinyCrayon%2FTinyCrayon-iOS-SDK/lists"}