React-native-photo-editor - Photo editor using native modules for iOS and Android

Overview

React Native Photo Editor (RNPE)

๐ŸŒ„ Image editor using native modules for iOS and Android. Inherit from 2 available libraries, ZLImageEditor (iOS) and PhotoEditor (Android)

Note

The difference between the 2 platforms is huge - Be careful when using
This lib is for personal use, so if you customize your style or change something, Please fork this library and check the detailed documentation in the original library:

During the development of this package. I was thinking of moving it as part of an earlier library that I finished. If the support community for this library was large enough, I would have to dismiss this idea immediately.

Previously this library used Brightroom as the native library for iOS. If you want to use Brightroom you can check it out here.

Feature ๐Ÿ™ˆ

Both

  • Draw (Support custom line color).
  • Adding/Editing Text with option to change its Color.
  • Adding Images/Stickers
  • Pinch to Scale and Rotate views.

iOS

  • Apply Filter Effect on image using LUT Color (Custom filter is simpler than android)
  • Crop image.

Android

  • Drawing on image with option to change its Brush's Color, Size, Opacity, Erasing and basic shapes.
  • Apply Filter Effect on image using MediaEffect. But in the future will change to LUT color.

Video Demo ๐Ÿ“บ

iOS Android
demo.mp4
demo_android.1.mov

ScreenShot ๐Ÿ‘‰ ๐Ÿ‘ˆ

iOS


Android

Requirements

  • Swift 5.1+ (Xcode12.4+)
  • iOS 12+

Installation

yarn add @baronha/react-native-photo-editor

iOS

The Swift pod @baronha/react-native-photo-editor depends upon SDWebImage and SDWebImageWebPCoder, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies:

pod 'SDWebImage', :modular_headers => true
pod 'SDWebImageWebPCoder', :modular_headers => true

Then run cd ios/ && pod install

Don't forget add file .swift in your project (and create bridging header file swift).

Usage

import PhotoEditor from "@baronha/react-native-photo-editor";

// ...

const result = await PhotoEditor.open(Options);

Options

Property Type Default value Platform Description
path string required both Local/remote image path
stickers Array [] both An array of paths containing sticker images

Filters ๐ŸŒˆ

iOS Android

Custom Filters(iOS)

LUT (Hald image)

How to create cube data from LUT Image

We can download the neutral LUT image from lutCreator.js.

Hald Images

Hald is a graphical representation of 3D LUT in a form of a color table which contains all of the color gradations of 3D LUT. If Hald is loaded into editing software and a color correction is applied to it, you can use 3D LUT Creator to convert your Hald into 3D LUT and apply it to a photo or a video in your editor.

Detailed documentations are available on here

IMPORTANT You have to create LUTs.bundle and add all your LUT Photo(Re-name your LUT Photo follow this format: LUT_64_FILTER_NAME) into LUTs.bundle. Then add LUTs.bundle into Copy Bundle Resources. See detail

Stickers ๐ŸคŒ

Remote

You need to pass an array of image urls to the sticker parameter in options Example:

[
  "https://cdn-icons-png.flaticon.com/512/5272/5272912.png",
  "https://cdn-icons-png.flaticon.com/512/5272/5272913.png",
  "https://cdn-icons-png.flaticon.com/512/5272/5272916.png",
  ...
] 

Local

iOS

You have to create Stickers.bundle and add all your sticker into Stickers.bundle. Then add Stickers.bundle into Copy Bundle Resources. See detail

Android

You have to create Stickers folder inside assets folder. Then drag or copy all sticker in to Sticker folder. See detail

To Do

  • Lut Color in android.
  • Crop Image in android.

Performance

We're trying to improve performance. If you have a better solution, please open a issue or pull request. Best regards!

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Comments
  •  Showing All Errors Only Undefined symbol: (extension in Accelerate):__C.vImage_Buffer.free() -> ()

    Showing All Errors Only Undefined symbol: (extension in Accelerate):__C.vImage_Buffer.free() -> ()

    Hi, I am using this plugin for react native app which is used for editing image in both android and ios. It is working fine for android but for ios it is giving this error Showing All Errors Only Undefined symbol: (extension in Accelerate):__C.vImage_Buffer.free() -> () $defer #1 () -> () in (extension in react_native_photo_editor):__C.UIImage.resize_vI(__C.CGSize) -> __C.UIImage? in libreact-native-photo-editor.a(UIImage+ZLImageEditor.o) ld: symbol(s) not found for architecture x86_64

    I have done the setup mentioned in the doc.

    opened by grvsingh789 5
  • Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15

    Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15

    Hi, I got error on invalid Kotlin version when running react-native run-android

    React Native version: 0.69.3

    e: /Users/wilson/work/carlink/CarlinkApp/node_modules/@baronha/react-native-photo-editor/android/src/main/java/com/reactnativephotoeditor/activity/PhotoEditorActivity.kt: (105, 5): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.

    opened by wilsontwm 4
  • Issue compiling on xcode 12.4

    Issue compiling on xcode 12.4

    I seems that the ZLImage editor lib causes a swift compile error here: https://github.com/baronha/react-native-photo-editor/blob/master/ios/ZLImageEditor/Sources/General/ZLEditImageViewController.swift#L289

    I am seeing the error "Type of expression is ambiguous without more context"

    opened by jonotrybe 2
  • requiresMainQueueSetup warning

    requiresMainQueueSetup warning

    Module PhotoEditor requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. 
    In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
    

    I am seeing this warning every time the app launches, please investigate.

    This seems to be a solution, but I can't find which file to edit for this library.

    opened by kockok 1
  • Example project - Unable to resolve @babel/runtime (iOS)

    Example project - Unable to resolve @babel/runtime (iOS)

    Tried to build and run project in example folder, but stucks after run: Unable to resolve module @babel/runtime/helpers/interopRequireDefault

    ะกะฝะธะผะพะบ ัะบั€ะฐะฝะฐ 2021-11-28 ะฒ 20 08 09

    Even when i cleaned cache or reinstalled node_modules.

    Environment: Platform - iOS XCode - Version 13.1 React Native - 0.64.2 npm - 8.1.4

    opened by vladimirevstratov 1
  • How to use luts

    How to use luts

    Hi there, I'm trying to embed the editor into my app. The editor does work but there are no filters available besides the default "normal". I think I have put the LUTS files under /ios/LUTs as the example does.

    image

    Am I missing something?

    opened by chitosai 1
  • Problem facing in installation

    Problem facing in installation

    I'm getting this error while I run the command pod install in iOS folder

    [!] CocoaPods could not find compatible versions for pod "react-native-photo-editor": In Podfile: react-native-photo-editor (from ../node_modules/@baronha/react-native-photo-editor)

    Specs satisfying the react-native-photo-editor (from../node_modules/@baronha/react-native-photo-editor) dependency were found, but they required a higher minimum deployment target.

    please help me

    react-native version latest platform :ios, '11.0'

    opened by aloksingh0308 1
  • Not open a local image by uri

    Not open a local image by uri

    On IOS I can not open the photo editor by .open() when I use local path URI ( it works by remote URL )

    example: path: "file:///Users/abc/Library/Developer/CoreSimulator/Devices/EEA5C63E-7295-4A7A-B170-44827A3648C8/data/Containers/Data/Application/773955FB-5A11-4C0C-9744-C3E3DBD6AC0D/tmp/C772C64E-6113-47A3-8CCE-898E52CB0FB9.jpg"

    Could you help me how to show the editor when using a URI local or captured by the camera?

    opened by windcloudit 0
  • Android crashing after edit and hit save button

    Android crashing after edit and hit save button

    Fatal Exception: java.lang.RuntimeException An error occurred while executing doInBackground() android.os.AsyncTask$4.done (AsyncTask.java:399)

    java.lang.Thread.run (Thread.java:919)

    Caused by java.lang.IndexOutOfBoundsException Index: 1, Size: 0 java.util.ArrayList.get (ArrayList.java:437)

    android.view.View.draw (View.java:23185) ja.burhanrashid52.photoeditor.PhotoSaverTask.captureView (PhotoSaverTask.java:161) ja.burhanrashid52.photoeditor.PhotoSaverTask.buildBitmap (PhotoSaverTask.java:104) ja.burhanrashid52.photoeditor.PhotoSaverTask.saveImageInFile (PhotoSaverTask.java:88) ja.burhanrashid52.photoeditor.PhotoSaverTask.doInBackground (PhotoSaverTask.java:70) ja.burhanrashid52.photoeditor.PhotoSaverTask.doInBackground (PhotoSaverTask.java:23)

    Screenshot 2022-11-29 at 10 44 44 AM

    I see same issue in native library too => https://github.com/burhanrashid52/PhotoEditor/issues/374 Can you look into this please @baronha

    opened by mahmed101 0
  •  Error when building or after installing the library: Task :@baronha_react-native-photo-editor:compileReleaseKotlin FAILED

    Error when building or after installing the library: Task :@baronha_react-native-photo-editor:compileReleaseKotlin FAILED

    As soon as I run yarn run android the library breaks, and it doesn't let me build it, the error is this: FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':baronha_react-native-photo-editor:compileDebugKotlin'.

    Compilation error. See log for more details

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org
    opened by Groisa 0
Releases(v1.1.2)
Owner
Baron Ha.
Baron Ha.
DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

DTPhotoViewerController Example Demo video: https://youtu.be/aTLx4M4zsKk DTPhotoViewerController is very simple to use, if you want to display only on

Tung Vo 277 Dec 17, 2022
FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor Quick demo Batch select/deselect Smoo

Cong Nguyen 648 Dec 27, 2022
PhotoEditor SDK: A fully customizable photo editor for your app.

About PhotoEditor SDK for iOS Our SDK provides tools for adding photo editing capabilities to your iOS application with a big variety of filters that

IMG.LY 116 Jan 1, 2023
A photo gallery for iOS with a modern feature set. Similar features as the Facebook photo browser.

EBPhotoPages โ€A photo gallery can become a pretty complex component of an app very quickly. The EBPhotoPages project demonstrates how a developer coul

Eddy Borja 1.7k Dec 8, 2022
DGCropImage - A photo cropping tool which mimics Photo.app written by Swift

DGCropImage A photo cropping tool which mimics Photo.app written by Swift. This

donggyu 11 Jul 14, 2022
Photo-Sharing-App - Photo Sharing App With Swift

Photo Sharing App You can register and log in to this application and share your

YaฤŸฤฑz Savran 2 Jun 14, 2022
React-native-image-generator - Library to generate images from layers

react-native-image-generator Library for generate images from other images Insta

Evgeny Usov 13 Nov 16, 2022
๐Ÿ“ท A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
๐Ÿ“ท A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023
A free, multiplatform SDK for real-time facial motion capture using blendshapes, and rigid head pose in 3D space from any RGB camera, photo, or video.

mocap4face by Facemoji mocap4face by Facemoji is a free, multiplatform SDK for real-time facial motion capture based on Facial Action Coding System or

Facemoji 592 Jan 1, 2023
PhotoApp - A Simple Photo App using Swift and MVC pattern

PhotoApp A Simple Photo App using Swift and MVC pattern After App launch, you wi

null 2 Aug 14, 2022
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

null 8 Dec 16, 2022
Image Editor iOS App - CLEAN Architecture + MVP Pattern

Image Editor iOS Application - Built using UIKit, CoreData, CoreImage, and URLSession Frameworks with CLEAN Architecture and MVP UI design pattern.

Omran Khoja 8 Nov 30, 2022
Photo Gallery App demo using a REST API

Photo Gallery iOS App - (Using Rest API) A demo Photo Gallery App using a Rest API using MVVM architecture in Swift + UIKit. Overview Fully Programmat

Neel Mewada 2 Nov 22, 2021
Xcode plugin to open the GitHub page of the commit of the currently selected line in the editor window.

Show in GitHub / BitBucket Xcode plugin to open a related Github or BitBucket page directly from the Xcode editor code window. Installs easily through

Lars Schneider 242 Jul 20, 2022
A simple iOS photo and video browser with grid view, captions and selections.

MWPhotoBrowser A simple iOS photo and video browser with optional grid view, captions and selections. MWPhotoBrowser can display one or more images or

Michael Waterfall 8.8k Dec 27, 2022
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more

IDMPhotoBrowser IDMPhotoBrowser is a new implementation based on MWPhotoBrowser. We've added both user experience and technical features inspired by F

Thiago Peres 2.7k Dec 21, 2022
This simple cordova plugin will download picture from an URL and save to IOS Photo Gallery.

Photo Viewer This plugin is intended to download a picture from an URL into IOS Photo library.. How to Install Cordova: cordova plugin add https://git

Alwin jose 1 Oct 23, 2021
Custom iOS camera and photo picker with editing capabilities

Overview Paparazzo is a component for picking and editing photos. Key Features ?? Taking photos using camera ?? Picking photos from user's photo libra

avito.tech 757 Jan 4, 2023