Giter Site home page Giter Site logo

photofilterrxswift's Introduction

GitHub all releases GitHub language count GitHub followers GitHub forks GitHub Repo stars GitHub watchers Twitter Follow


Logo

Photo Filter with RxSwift

It is a project where you can learn CoreImage, Photos and Rxswift libraries in depth.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

With this project, we can edit, crop and share photos on social media with presets filters.

Logo Logo Logo Logo Logo

Here's why:

  • To learn CoreImage and Photos Library
  • To learn RxSwift and reactive programming.

Built With

The frameworks I used in this project are listed below.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Requirements

  • Xcode 12.x
  • Swift 5.x

For Xcode 11 and below, use RxSwift 5.x.

Installation

RxSwift doesn't contain any external dependencies.

These are currently the supported installation options:

Manual

Open Rx.xcworkspace, choose RxExample and hit run. This method will build everything and run the sample app

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'RxSwift', '6.1.0'
    pod 'RxCocoa', '6.1.0'
end

# RxTest and RxBlocking make the most sense in the context of unit/integration tests
target 'YOUR_TESTING_TARGET' do
    pod 'RxBlocking', '6.1.0'
    pod 'RxTest', '6.1.0'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Usage

Here's an example
Filter a photo...
    private func applyFilter(to inputImage: UIImage, value: Float, myFilter: Filters, completion: @escaping ((UIImage) -> ())) {
    let filter = CIFilter(name: myFilter.filterName)!
    filter.setValue(value, forKey: myFilter.filterKey)
    
    if let sourceImage = CIImage(image: inputImage) {
        
        filter.setValue(sourceImage, forKey: kCIInputImageKey)
        
        if let cgimg = self.context.createCGImage(filter.outputImage!, from: filter.outputImage!.extent) {
            
            let processedImage = UIImage(cgImage: cgimg, scale: inputImage.scale, orientation: inputImage.imageOrientation)
            completion(processedImage)
        }
    }
}

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Bilal Durnagöl | Twitter Bilal Durnagöl | Medium Bilal Durnagöl | Instagram Bilal Durnagöl | LinkedIn

Project Link: https://github.com/bilaldurnagol/PhotoFilterRxSwift

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.