{"id":26584480,"url":"https://github.com/kawoou/flexibleimage","last_synced_at":"2025-04-06T11:07:24.270Z","repository":{"id":44430787,"uuid":"90093838","full_name":"kawoou/FlexibleImage","owner":"kawoou","description":"A simple way to play with the image!","archived":false,"fork":false,"pushed_at":"2018-11-03T06:08:23.000Z","size":2161,"stargazers_count":827,"open_issues_count":1,"forks_count":47,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-30T10:06:26.770Z","etag":null,"topics":["filter","image-processing","ios","macos","metal","playground","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"","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/kawoou.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-05-03T01:13:36.000Z","updated_at":"2025-03-23T02:13:39.000Z","dependencies_parsed_at":"2022-08-31T15:10:18.788Z","dependency_job_id":null,"html_url":"https://github.com/kawoou/FlexibleImage","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawoou%2FFlexibleImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawoou%2FFlexibleImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawoou%2FFlexibleImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawoou%2FFlexibleImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kawoou","download_url":"https://codeload.github.com/kawoou/FlexibleImage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471517,"owners_count":20944158,"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":["filter","image-processing","ios","macos","metal","playground","swift","tvos","watchos"],"created_at":"2025-03-23T09:35:23.913Z","updated_at":"2025-04-06T11:07:24.245Z","avatar_url":"https://github.com/kawoou.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"FlexibleImage\" src=\"https://github.com/kawoou/FlexibleImage/raw/master/Preview/Cover.png\" style=\"max-width: 100%\"\u003e\n\n\u003ccenter\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Swift\" src=\"https://img.shields.io/badge/Swift-4.1-orange.svg\"\u003e\n  \u003ca href=\"https://developer.apple.com/metal/\" target=\"_blank\"\u003e\u003cimg alt=\"Metal\" src=\"https://img.shields.io/badge/Apple-Metal-ff00ff.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://cocoadocs.org/docsets/FlexibleImage\" target=\"_blank\"\u003e\u003cimg alt=\"Platform\" src=\"http://img.shields.io/cocoapods/p/FlexibleImage.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/kawoou/FlexibleImage/blob/master/LICENSE\" target=\"_blank\"\u003e\u003cimg alt=\"License\" src=\"http://img.shields.io/cocoapods/l/FlexibleImage.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://travis-ci.org/kawoou/FlexibleImage\" target=\"_blank\"\u003e\u003cimg alt=\"Build Status\" src=\"https://travis-ci.org/kawoou/FlexibleImage.svg?branch=master\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://cocoadocs.org/docsets/FlexibleImage\" target=\"_blank\"\u003e\u003cimg alt=\"Version\" src=\"http://img.shields.io/cocoapods/v/FlexibleImage.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Carthage/Carthage\" target=\"_blank\"\u003e\u003cimg alt=\"Carthage compatible\" src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003c/center\u003e\n\nFlexibleImage is implemented with the hope that anyone could easily develop an app that provides features such as Camera Filter and Theme. When you write code in the \"Method Chaining\" style, the effect is applied in the appropriate order.\n\nYou may want to see [Examples](#-example) section first if you'd like to see the actual code.\n\n\u003cbr\u003e\n\n💡 Usage\n-----\n\n### Code\n\n![Example Image](https://github.com/kawoou/FlexibleImage/raw/master/Preview/Example.png)\n\n```swift\nimport UIKit\n\nimport FlexibleImage\n\n/// Generate Example\nlet image1 = UIImage\n    .circle(\n        color: UIColor.blue,\n        size: CGSize(width: 100, height: 100)\n    )!\n    \n    .adjust()\n    .offset(CGPoint(x: 25, y: 0))\n    .margin(UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5))\n    .padding(UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15))\n    .normal(color: UIColor.white)\n    .border(color: UIColor.red, lineWidth: 5, radius: 50)\n    .image()!\n    \n    .adjust()\n    .background(color: UIColor.darkGray)\n    .image()\n\n\n/// Effect Example\nlet image2 = UIImage(named: \"macaron.jpg\")!\n    .adjust()\n    .outputSize(CGSize(width: 250, height: 250))\n    .exclusion(color: UIColor(red: 0, green: 0, blue: 0.352941176, alpha: 1.0))\n    .linearDodge(color: UIColor(red: 0.125490196, green: 0.058823529, blue: 0.192156863, alpha: 1.0))\n    .hardMix(color: UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0))\n    .image()\n\n\n/// Mix Example\nlet image3 = image2!.adjust()\n    .append(\n        image1!.adjust()\n            .outputSize(CGSize(width: 250, height: 250))\n            .alpha(0.5)\n    )\n    .image()\n\n/// Clipping Example\nlet image4 = image3!.adjust()\n    .corner(CornerType(25))\n    .image()\n\n/// Pipeline\nlet pipeline = ImagePipeline()\n        .exclusion(color: UIColor(red: 0, green: 0, blue: 0.352941176, alpha: 1.0))\n        .linearDodge(color: UIColor(red: 0.125490196, green: 0.058823529, blue: 0.192156863, alpha: 1.0))\n\nlet image5 = pipeline.image(image2)\nlet image6 = pipeline.image(image1)\n```\n\n\n### Playground\n\nUse CocoaPods command `$ pod try FlexibleImage` to try Playground!\n\n\u003cbr\u003e\n\n🏗 Installation\n------------\n\n### [CocoaPods](https://cocoapods.org) (For iOS 8+ projects)\n\nKWDrawerController is available on [CocoaPods](https://github.com/cocoapods/cocoapods). Add the following to your Podfile:\n\n```ruby\n/// Swift 3\npod 'FlexibleImage', '~\u003e 1.7'\n\n/// Swift 4\npod 'FlexibleImage', '~\u003e 1.9'\n```\n\n\n### [Carthage](https://github.com/Carthage/Carthage) (For iOS 8+ projects)\n\n```\ngithub \"kawoou/FlexibleImage\" ~\u003e 1.9\n```\n\n\n### Manually\n\nYou can either simply drag and drop the `Sources` folder into your existing project.\n\n\u003cbr\u003e\n\n📕 Supported Features\n------------------\n\n### Common\n\n| Type | Parameter | Comments |\n| ---- | --------- | -------- |\n| background() | Color | Background color. |\n| opacity() | Float | Change the transparency of the image. |\n| alphaProcess() | Bool | Whether to include an alpha value during image processing. |\n| ~~blendMode()~~ | ~~CGBlendMode~~ | (Deprecated) ~~Blend mode of the image~~ |\n| offset() | CGPoint | The position of the image to be a drawing. |\n| rotate() | radius: CGFloat\u003cbr/\u003efixedSize: CGSize [Optional] | Rotate an image. |\n| size() | CGSize | The size of the image to be a drawing. |\n| outputSize() | CGSize | The size of a Output image. |\n| scaling() | CGSize | Scaling the image (ratio) |\n| margin() | EdgeInsets | Margin size |\n| padding() | EdgeInsets | Padding size |\n| corner() | CornerType | To clipping corner radius. |\n| border() | color: Color\u003cbr/\u003elineWidth: CGFloat\u003cbr/\u003eradius: CGFloat | Drawing a border. |\n| image() | | Run the pipeline to create the Output image. |\n\n\n### Filter\n\n| Type | Parameter | Comments |\n| ---- | --------- | -------- |\n| greyscale() | threshold: Float [Optional] | |\n| monochrome() | threshold: Float [Optional] | |\n| invert() | | |\n| sepia() | | |\n| vibrance() | vibrance: Float [Optional] | |\n| solarize() | threshold: Float [Optional] | |\n| posterize() | colorLevel: Float [Optional] | |\n| blur() | blurRadius: Float [Optional] | Not supported by watchOS. |\n| brightness() | brightness: Float [Optional] | |\n| chromaKey() | color: FIColor\u003cbr/\u003ethreshold: Float [Optional]\u003cbr/\u003esmoothing: Float [Optional] | |\n| swizzling() | | |\n| contrast() | threshold: Float [Optional] | |\n| gamma() | gamma: Float [Optional] | |\n\n\n### Blend\n\n| Type | Parameter |\n| ---- | --------- |\n| normal() | Color |\n| multiply() | Color |\n| lighten() | Color |\n| darken() | Color |\n| average() | Color |\n| add() | Color |\n| subtract() | Color |\n| difference() | Color |\n| negative() | Color |\n| screen() | Color |\n| exclusion() | Color |\n| overlay() | Color |\n| softLight() | Color |\n| hardLight() | Color |\n| colorDodge() | Color |\n| colorBurn() | Color |\n| linearDodge() | Color |\n| linearBurn() | Color |\n| linearLight() | Color |\n| vividLight() | Color |\n| pinLight() | Color |\n| hardMix() | Color |\n| reflect() | Color |\n| glow() | Color |\n| phoenix() | Color |\n| hue() | Color |\n| saturation() | Color |\n| color() | Color |\n| luminosity() | Color |\n\n\n### Post-processing\n\n| Type | Parameter | Comments |\n| ---- | --------- | -------- |\n| algorithm() | AlgorithmType | Create an image by writing a formula directly on a pixel-by-pixel basis. |\n| custom() | ContextType | Add processing directly using Core Graphics. |\n\n\n### Generate\n\n| Type | Comments |\n| ---- | -------- |\n| rect() | Create a rectangular image. |\n| circle() | Create a circle image. |\n| append() | Combine images to create a single image. |\n\n\n### Pipeline (`ImagePipeline` class)\n\n| Type | Parameter | Return | Comments |\n| ---- | --------- | ------ | -------- |\n| image() | FIImage | FIImage? | Create the Output image. |\n| image() | CGImage | CGImage? | Create the Output image. |\n| image() | CVImageBuffer | CGImage? | Create the Output image. |\n\n\u003cbr\u003e\n\n🎁 Example\n-------\n\n- [iOS APP Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-app-iOS)\n- [iOS Playground Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-playground-iOS.playground)\n- [macOS App Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-app-macOS)\n- [macOS Playground Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-playground-macOS.playground)\n- [tvOS App Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-app-tvOS)\n- [tvOS Playground Example](https://github.com/kawoou/FlexibleImage/tree/master/Example-playground-tvOS.playground)\n\n\u003cbr\u003e\n\n🏷 Changelog\n---------\n\n+ 1.0\n  - First Release.\n+ 1.1\n  - Add to clipping corner radius.\n+ 1.2\n  - Support tvOS, macOS.\n+ 1.3\n  - Support watchOS.\n  - Added monochrome, sepia, vibrance, solarize, posterize filters.\n  - Update resize methods.\n+ 1.4\n  - Add blur filter.\n  - Optimize build time.\n  - Setup TravisCI\n  - Support carthage.\n+ 1.5\n  - Support Metal depending on the situation.\n  - Added brightness, chromaKey, swizzling, contrast, gamma filters.\n+ 1.6 (Hotfix!)\n  - Fix issue Metal library path on Cocoapods.\n+ 1.7\n  - Pipelined implementation for stream processing.\n  - Fix rendering bug due to image orientation (Thanks to Kwonyoon Kang)\n+ 1.8\n  - Support for Swift 4 and Xcode 9\n+ 1.9\n  - Support for Swift 4.1 and Xcode 9.3\n+ 1.10\n  - Support for Swift 4.2 and Xcode 10\n\n\u003cbr\u003e\n\n💻 Requirements\n------------\n\n- iOS 8.0+\n- tvOS 9.0+\n- macOS 10.10+\n- watchOS 2.0+\n- Swift 3.0+\n\n\u003cbr\u003e\n\n🔑 License\n-------\n\nFlexibleImage is under MIT license. See the LICENSE file for more info.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawoou%2Fflexibleimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkawoou%2Fflexibleimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawoou%2Fflexibleimage/lists"}