All Projects → kawoou → Flexibleimage

kawoou / Flexibleimage

Licence: mit
A simple way to play with the image!

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Flexibleimage

Metalpetal
A GPU accelerated image and video processing framework built on Metal.
Stars: ✭ 907 (+13.66%)
Mutual labels:  metal, image-processing, tvos, filter
Xcake
🍰 Describe Xcode projects in a human readable format and (re)generate one on demand.
Stars: ✭ 549 (-31.2%)
Mutual labels:  tvos, watchos
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (-33.96%)
Mutual labels:  tvos, watchos
Purchases Ios
In-app purchases and subscriptions made easy. iOS, MacOS, iPadOS, tvOS, and WatchOS support.
Stars: ✭ 614 (-23.06%)
Mutual labels:  tvos, watchos
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+3512.28%)
Mutual labels:  tvos, watchos
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (-39.72%)
Mutual labels:  tvos, watchos
Ouzel
C++ game engine for Windows, macOS, Linux, iOS, tvOS, Android, and web browsers
Stars: ✭ 607 (-23.93%)
Mutual labels:  metal, tvos
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (-44.86%)
Mutual labels:  tvos, watchos
Flint
The Flint framework for building apps on Apple platforms using Feature Driven Development
Stars: ✭ 636 (-20.3%)
Mutual labels:  tvos, watchos
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (-19.67%)
Mutual labels:  tvos, watchos
Dynamicjson
Access JSON properties dynamically like JavaScript using Swift 4.2's new @dynamicMemberLookup feature
Stars: ✭ 678 (-15.04%)
Mutual labels:  tvos, watchos
Gridstack
A flexible grid layout view for SwiftUI
Stars: ✭ 474 (-40.6%)
Mutual labels:  tvos, watchos
Gaussianblur
An easy and fast library to apply gaussian blur filter on any images. 🎩
Stars: ✭ 473 (-40.73%)
Mutual labels:  image-processing, filter
Swiftyutils
All the reusable code that we need in each project
Stars: ✭ 490 (-38.6%)
Mutual labels:  tvos, watchos
Pesdk Android Demo
A fully customizable photo editor for your app.
Stars: ✭ 464 (-41.85%)
Mutual labels:  image-processing, filter
Countly Sdk Ios
Countly Product Analytics iOS SDK with macOS, watchOS and tvOS support.
Stars: ✭ 585 (-26.69%)
Mutual labels:  tvos, watchos
Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (-9.27%)
Mutual labels:  tvos, watchos
Userdefaultsstore
Why not use UserDefaults to store Codable objects 😉
Stars: ✭ 416 (-47.87%)
Mutual labels:  tvos, watchos
Swiftuipager
Native Pager in SwiftUI
Stars: ✭ 430 (-46.12%)
Mutual labels:  tvos, watchos
Samkeychain
Simple Objective-C wrapper for the keychain that works on Mac and iOS
Stars: ✭ 5,389 (+575.31%)
Mutual labels:  tvos, watchos
FlexibleImage

Swift Metal Platform License
Build Status Version Carthage compatible

FlexibleImage 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.

You may want to see Examples section first if you'd like to see the actual code.


💡 Usage

Code

Example Image

import UIKit

import FlexibleImage

/// Generate Example
let image1 = UIImage
    .circle(
        color: UIColor.blue,
        size: CGSize(width: 100, height: 100)
    )!
    
    .adjust()
    .offset(CGPoint(x: 25, y: 0))
    .margin(UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5))
    .padding(UIEdgeInsets(top: 15, left: 15, bottom: 15, right: 15))
    .normal(color: UIColor.white)
    .border(color: UIColor.red, lineWidth: 5, radius: 50)
    .image()!
    
    .adjust()
    .background(color: UIColor.darkGray)
    .image()


/// Effect Example
let image2 = UIImage(named: "macaron.jpg")!
    .adjust()
    .outputSize(CGSize(width: 250, height: 250))
    .exclusion(color: UIColor(red: 0, green: 0, blue: 0.352941176, alpha: 1.0))
    .linearDodge(color: UIColor(red: 0.125490196, green: 0.058823529, blue: 0.192156863, alpha: 1.0))
    .hardMix(color: UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1.0))
    .image()


/// Mix Example
let image3 = image2!.adjust()
    .append(
        image1!.adjust()
            .outputSize(CGSize(width: 250, height: 250))
            .alpha(0.5)
    )
    .image()

/// Clipping Example
let image4 = image3!.adjust()
    .corner(CornerType(25))
    .image()

/// Pipeline
let pipeline = ImagePipeline()
        .exclusion(color: UIColor(red: 0, green: 0, blue: 0.352941176, alpha: 1.0))
        .linearDodge(color: UIColor(red: 0.125490196, green: 0.058823529, blue: 0.192156863, alpha: 1.0))

let image5 = pipeline.image(image2)
let image6 = pipeline.image(image1)

Playground

Use CocoaPods command $ pod try FlexibleImage to try Playground!


🏗 Installation

CocoaPods (For iOS 8+ projects)

KWDrawerController is available on CocoaPods. Add the following to your Podfile:

/// Swift 3
pod 'FlexibleImage', '~> 1.7'

/// Swift 4
pod 'FlexibleImage', '~> 1.9'

Carthage (For iOS 8+ projects)

github "kawoou/FlexibleImage" ~> 1.9

Manually

You can either simply drag and drop the Sources folder into your existing project.


📕 Supported Features

Common

Type Parameter Comments
background() Color Background color.
opacity() Float Change the transparency of the image.
alphaProcess() Bool Whether to include an alpha value during image processing.
blendMode() CGBlendMode (Deprecated) Blend mode of the image
offset() CGPoint The position of the image to be a drawing.
rotate() radius: CGFloat
fixedSize: CGSize [Optional]
Rotate an image.
size() CGSize The size of the image to be a drawing.
outputSize() CGSize The size of a Output image.
scaling() CGSize Scaling the image (ratio)
margin() EdgeInsets Margin size
padding() EdgeInsets Padding size
corner() CornerType To clipping corner radius.
border() color: Color
lineWidth: CGFloat
radius: CGFloat
Drawing a border.
image() Run the pipeline to create the Output image.

Filter

Type Parameter Comments
greyscale() threshold: Float [Optional]
monochrome() threshold: Float [Optional]
invert()
sepia()
vibrance() vibrance: Float [Optional]
solarize() threshold: Float [Optional]
posterize() colorLevel: Float [Optional]
blur() blurRadius: Float [Optional] Not supported by watchOS.
brightness() brightness: Float [Optional]
chromaKey() color: FIColor
threshold: Float [Optional]
smoothing: Float [Optional]
swizzling()
contrast() threshold: Float [Optional]
gamma() gamma: Float [Optional]

Blend

Type Parameter
normal() Color
multiply() Color
lighten() Color
darken() Color
average() Color
add() Color
subtract() Color
difference() Color
negative() Color
screen() Color
exclusion() Color
overlay() Color
softLight() Color
hardLight() Color
colorDodge() Color
colorBurn() Color
linearDodge() Color
linearBurn() Color
linearLight() Color
vividLight() Color
pinLight() Color
hardMix() Color
reflect() Color
glow() Color
phoenix() Color
hue() Color
saturation() Color
color() Color
luminosity() Color

Post-processing

Type Parameter Comments
algorithm() AlgorithmType Create an image by writing a formula directly on a pixel-by-pixel basis.
custom() ContextType Add processing directly using Core Graphics.

Generate

Type Comments
rect() Create a rectangular image.
circle() Create a circle image.
append() Combine images to create a single image.

Pipeline (ImagePipeline class)

Type Parameter Return Comments
image() FIImage FIImage? Create the Output image.
image() CGImage CGImage? Create the Output image.
image() CVImageBuffer CGImage? Create the Output image.

🎁 Example


🏷 Changelog

  • 1.0
    • First Release.
  • 1.1
    • Add to clipping corner radius.
  • 1.2
    • Support tvOS, macOS.
  • 1.3
    • Support watchOS.
    • Added monochrome, sepia, vibrance, solarize, posterize filters.
    • Update resize methods.
  • 1.4
    • Add blur filter.
    • Optimize build time.
    • Setup TravisCI
    • Support carthage.
  • 1.5
    • Support Metal depending on the situation.
    • Added brightness, chromaKey, swizzling, contrast, gamma filters.
  • 1.6 (Hotfix!)
    • Fix issue Metal library path on Cocoapods.
  • 1.7
    • Pipelined implementation for stream processing.
    • Fix rendering bug due to image orientation (Thanks to Kwonyoon Kang)
  • 1.8
    • Support for Swift 4 and Xcode 9
  • 1.9
    • Support for Swift 4.1 and Xcode 9.3
  • 1.10
    • Support for Swift 4.2 and Xcode 10

💻 Requirements

  • iOS 8.0+
  • tvOS 9.0+
  • macOS 10.10+
  • watchOS 2.0+
  • Swift 3.0+

🔑 License

FlexibleImage is under MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].