• Stars
    star
    623
  • Rank 72,088 (Top 2 %)
  • Language
    Java
  • License
    Other
  • Created almost 9 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PhotoEditor SDK: A fully customizable photo editor for your app.

PhotoEditor SDK Logo

Maven Twitter

About PhotoEditor SDK for Android

Overview

The PhotoEditor SDK is a powerful and multifaceted tool which enables you to equip your Android application with high-performant photo editing capabilities. The PhotoEditor SDK is written in Java and can easily be customized to entirely blend with your CI and provide your users with the exact feature set your use-case requires.

The SDK ships with a large variety of filters, covering all state of the art style- and mood settings that can be previewed in real-time. Unlike other apps that allow a live preview of filters, the PhotoEditor SDK even provides a live preview when using high-resolution images.

All operations are non-destructive which allows for fast and uncomplicated revision of the creatives at any given time and creates an intuitive and creative workflow for your users. Please see Features for a detailed list of the photo editing tools included in the PhotoEditor SDK.

Get it on Google Play

License

The PhotoEditorSDK is a product of img.ly GmbH. Please make sure that you have a commercial license before releasing your app. A commercial license is required if you would like to integrate the SDK into any app, regardless of whether you monetize directly (paid app, subscription, service fee), indirectly (advertising, etc.) or are developing a free app. Every license for the PhotoEditor SDK is valid for one product only unless the products are closely related.

If you’d like to use the PhotoEditor SDK for a charitable project, you can do so free of charge. However, please contact us anyway, so we can evaluate whether you qualify for a non-commercial license or not and handle your request accordingly.

Please get in touch if you’d like to purchase a commercial license or require further information on our pricing and services. Please see the included LICENSE.md for licensing details.

Features

  • Over 60 handcrafted Filters covering all state of the art style- and mood settings to choose from.

  • Design custom filters in Photoshop and other apps: The API of the PhotoEditor SDK enables you to expand the filter library with your own set of custom filters to define a unique visual language. Custom filters can easily be created by anyone using LUTs (Lookup Tables) from popular apps like Photoshop, GIMP or Lightroom. Design your filter and apply it onto the provided identity image. That will 'record' the filter response, now simply save it and add it as a new filter. Done.

  • An Overlay Tool that can be used to create neat lighting effects like lens flare or bokeh but also to furnish pictures with textures like crumpled paper or plaster. You can easily expand the library by importing your own set of overlay assets.

  • An Adjustment section that holds both essential and advanced photo editing features like brightness, contrast, saturation, clarity etc. that help tweak and fine tune images to create stunning creatives.

  • A Transform section that unifies cropping, flipping and rotation in one feature.

  • The robust Text Feature provides all necessary functions for quickly adding text to any picture or creative. The corresponding font library can easily be exchanged, reduced, or expanded.

  • A categorized Sticker library whose UI is optimized for exploration and discovery. You can easily complement the library with your own custom sticker packages.

  • A Frame Tool that works with any given photo size or ratio.

  • A high performant Brush Engine optimized for touch screen that supports different brush strokes.

  • A Photo Roll equipped with a wide range of stock photography and templates with presorted categories. The API allows for easy expansion, reduction and rearrangement of the assets.

  • A clean and intuitive UI that ensures an unhindered flow of creativity and a seamless experience while composing creatives. The UI is designed to be customized to completely match your CI and blend with your app.

  • You can strip out every feature you deem unnecessary to provide your users with the exact feature set your use case requires.

  • Android API Level 21+ Covers nearly 98% of all Android devices with touchscreen.

  • Fast image export up to 4294 MegaPixel

  • Generic camera support for most Android phones.

  • Tablet support: The PhotoEditor SDK uses auto layout for its views and adapts to each screen size.

  • Non/destructive features and effects: Quickly revise, redo or even discard your work.

SDK Core

ACS Component
A generic Android Camera Stack library which is based on the android.hardware.Camera API. Supports front and rear cam, HDR, flash modes and much more.

SDK Component
The PhotoEditor core library for Android. Containing the OpenGL and toolkit implementation.

UI Component
The default UI components consisting of LivePreview and Editor Activity.

Documentation

For a detailed documentation, please take a look here.

Author

img.ly GmbH, @imgly, img.ly

Installation

The PhotoEditor SDK supports Android 5.0+ API 21 as the minSdkVersion, but it must be compiled with compileSdkVersion 31+.

Add your license file

Before using any components of the PhotoEditor SDK, you have to add your license file to your applications assets folder. The expected default name of the license file is "LICENSE". In order to change this, see licencePath option of PESDKConfig in your gradle file.

The license is digitally signed and can't be altered without becoming invalid. Our sample app comes with its own license, so you can try that right away. To try our SDK in your own app, you need to request a trial license that's bound to your bundle identifier. You can start a trial here and download your license file from your dashboard.

Once the license file has been added the application will validate its presence upon launch.

Setting up the workspace

Please ensure that our artifactory repository is listed in your repositories in the project’s build.gradle file:

// Add the PESDK repository and plugin dependency
buildscript {
    repositories {
        jcenter()
        google()
        maven { url "https://artifactory.img.ly/artifactory/imgly" }
    }
    dependencies {
        classpath 'ly.img.android.pesdk:plugin:10.7.2'
    }
}

Apply the img.ly plugin and add the imglyConfig block into your module's build.gradle file:

// Apply the Android Plugin
apply plugin: 'com.android.application'

// Apply the IMGLYPlugin
apply plugin: 'ly.img.android.sdk'

// Configure the PESDKPlugin
imglyConfig {

    // Optional: Enable the VideoEditor SDK
    vesdk {
        enabled true
        licencePath 'vesdk_android_license'
    }

    // Optional: Enable the PhotoEditor SDK
    pesdk {
        enabled true
        licencePath 'pesdk_android_license'
    }

    // Define the modules you are need
    modules {
        // Add all the UI modules you are need
        include 'ui:core'
        include 'ui:text'
        include 'ui:focus'
        include 'ui:frame'
        include 'ui:brush'
        include 'ui:filter'
        include 'ui:camera'
        include 'ui:sticker'
        include 'ui:overlay'
        include 'ui:transform'
        include 'ui:adjustment'

        // Add the serializer if you need
        include 'backend:serializer'

        // Add asset packs if you need
        include 'assets:font-basic'
        include 'assets:frame-basic'
        include 'assets:filter-basic'
        include 'assets:overlay-basic'
        include 'assets:sticker-shapes'
        include 'assets:sticker-emoticons'
    }
}

// Do your Android Configurations... ex.
android {
    /* Set the compileSdkVersion at 31 or greater and set the buildToolsVersion at '31.0.0' or greater.
     * We can't provide support for bugs, that are the result of older SDK versions.
     */
    compileSdkVersion 31
    buildToolsVersion '31.0.0'

    defaultConfig {
        /*
         * Replace with your App-ID and keep sure that it match with your license!
         * @see http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename
         */
        applicationId "my.domain.application"

        /* Set the minimum supported SDK Version to 21 (Android 5.0) or higher */
        minSdkVersion 21

        /* Set the target SDK Version at minimum to 29 or higher */
        targetSdkVersion 29

        /* Set your own Version Code and Version Name */
        versionCode 1
        versionName "1.0"
    }

    /* Set Java Language level to Java 1.8+ */
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Sync your project with the Gradle files after every edit! For more information about Gradle, please take a look at the Android Developer Documentation

Android Permissions

The PhotoEditor SDK requires two permissions: The "Write access to external storage" and the "Camera" permission (if you include the Camera module). You can grant this permissions yourself otherwise the SDK will automatically grant these permissions

Please take a look at the hint in the next step in order to integrate the Android 6.0 permission request correct!

Integration

Start Editor standalone

If you want to open the editor directly with an existing image look at this example:

class KEditorDemoActivity : Activity() {

    companion object {
        const val PESDK_RESULT = 1
        const val GALLERY_RESULT = 2
    }

    // Create a empty new SettingsList and apply the changes on this reference.
    // If you include our asset Packs and use our UI you also need to add them to the UI Config,
    // otherwise they are only available for the backend (like Serialisation)
    // See the specific feature sections of our guides if you want to know how to add your own Assets.
    private fun createPESDKSettingsList() =
        PhotoEditorSettingsList(true)
            .configure<UiConfigFilter> {
                it.setFilterList(FilterPackBasic.getFilterPack())
            }
            .configure<UiConfigText> {
                it.setFontList(FontPackBasic.getFontPack())
            }
            .configure<UiConfigFrame> {
                it.setFrameList(FramePackBasic.getFramePack())
            }
            .configure<UiConfigOverlay> {
                it.setOverlayList(OverlayPackBasic.getOverlayPack())
            }
            .configure<UiConfigSticker> {
                it.setStickerLists(
                    StickerPackEmoticons.getStickerCategory(),
                    StickerPackShapes.getStickerCategory()
                )
            }
            .configure<PhotoEditorSaveSettings> {
                it.setOutputToGallery(Environment.DIRECTORY_DCIM)
            }


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        openSystemGalleryToSelectAnImage()
    }

    fun openSystemGalleryToSelectAnImage() {
        val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
        try {
            startActivityForResult(intent, GALLERY_RESULT)
        } catch (ex: ActivityNotFoundException) {
            Toast.makeText(
                this,
                "No Gallery APP installed",
                Toast.LENGTH_LONG
            ).show()
        }
    }

    fun openEditor(inputImage: Uri?) {
        val settingsList = createPESDKSettingsList()

        settingsList.configure<LoadSettings> {
            it.source = inputImage
        }

        PhotoEditorBuilder(this)
            .setSettingsList(settingsList)
            .startActivityForResult(this, PESDK_RESULT)
        
        settingsList.release()
    }


    override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) {
        super.onActivityResult(requestCode, resultCode, intent)

        if (resultCode == RESULT_OK && requestCode == GALLERY_RESULT) {
            // Open Editor with some uri in this case with an image selected from the system gallery.
            openEditor(intent.data)

        } else if (resultCode == RESULT_OK && requestCode == PESDK_RESULT) {
            // Editor has saved an Image.
            val data = EditorSDKResult(intent)

            Log.i("PESDK", "Source image is located here ${data.sourceUri}")
            Log.i("PESDK", "Result image is located here ${data.resultUri}")

            // TODO: Do something with the result image

            // OPTIONAL: read the latest state to save it as a serialisation
            val lastState = data.settingsList
            try {
                IMGLYFileWriter(lastState).writeJson(File(
                    getExternalFilesDir(null),
                    "serialisationReadyToReadWithPESDKFileReader.json"
                ))
            } catch (e: IOException) {
                e.printStackTrace()
            }
            
            lastState.release()

        } else if (resultCode == RESULT_CANCELED && requestCode == PESDK_RESULT) {
            // Editor was canceled
            val data = EditorSDKResult(intent)

            val sourceURI = data.sourceUri
            // TODO: Do something with the source...
        }
    }
}

Start Editor (with camera)

In order to open the camera preview and pass the resulting image to the editor, create a CameraPreviewBuilder and start the CameraPreviewActivity with startActivityForResult(android.app.Activity, int):

The camera module requires two permissions: The "Write access to external storage" and the "Camera" permission. You can grant these permissions yourself otherwise the SDK will automatically grant these permissions.

Please make sure you delegate the onRequestPermissionsResult() to PermissionRequest.onRequestPermissionsResult() as demonstrated in the following example. This ensures correct behavior on Android 6.0 and above.

class KCameraDemoActivity : Activity(), PermissionRequest.Response {

    companion object {
        const val PESDK_RESULT = 1
    }

    // Important permission request for Android 6.0 and above, don't forget to add this!
    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
        PermissionRequest.onRequestPermissionsResult(requestCode, permissions, grantResults)
        super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    }

    override fun permissionGranted() {}

    override fun permissionDenied() {
        /* TODO: The Permission was rejected by the user. The Editor was not opened,
         * Show a hint to the user and try again. */
    }

    // Create a empty new SettingsList and apply the changes on this reference.
    // If you have included our asset Packs and you want to use our default UI you also need to add them to the UI config,
    // otherwise they are only available for the backend link serialisation.
    // See the specific feature sections of our guides if you want to know how to add your own assets.
    private fun createPESDKSettingsList() = PhotoEditorSettingsList(true)
        .configure<UiConfigFilter> {
            it.setFilterList(FilterPackBasic.getFilterPack())
        }
        .configure<UiConfigText> {
            it.setFontList(FontPackBasic.getFontPack())
        }
        .configure<UiConfigFrame> {
            it.setFrameList(FramePackBasic.getFramePack())
        }
        .configure<UiConfigOverlay> {
            it.setOverlayList(OverlayPackBasic.getOverlayPack())
        }
        .configure<UiConfigSticker> {
            it.setStickerLists(
                StickerPackEmoticons.getStickerCategory(),
                StickerPackShapes.getStickerCategory()
            )
        }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        openCamera()
    }

    private fun openCamera() {
        val settingsList = createPESDKSettingsList()

        CameraPreviewBuilder(this)
            .setSettingsList(settingsList)
            .startActivityForResult(this, PESDK_RESULT)

        settingsList.release()
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) {
        super.onActivityResult(requestCode, resultCode, intent)

        if (resultCode == RESULT_OK && requestCode == PESDK_RESULT) {
            // Editor has saved an Image.
            val data = EditorSDKResult(intent)

            Log.i("PESDK", "Source image is located here ${data.sourceUri}")
            Log.i("PESDK", "Result image is located here ${data.resultUri}")

            // TODO: Do something with the result image

            // OPTIONAL: read the latest state to save it as a serialisation
            val lastState = data.settingsList
            try {
                IMGLYFileWriter(lastState).writeJson(File(
                    getExternalFilesDir(null),
                    "serialisationReadyToReadWithPESDKFileReader.json"
                ))
            } catch (e: IOException) {
                e.printStackTrace()
            }

            lastState.release()

        } else if (resultCode == RESULT_CANCELED && requestCode == PESDK_RESULT) {
            // Editor was canceled
            val data = EditorSDKResult(intent)

            val sourceURI = data.sourceUri
            // TODO: Do something...
        }
    }
}

More Repositories

1

background-removal-js

Remove backgrounds from images directly in the browser environment with ease and no additional costs or privacy concerns. Explore an interactive demo.
TypeScript
5,708
star
2

pesdk-ios-examples

A fully customizable photo editor for your app.
856
star
3

imgly-sdk-html5

The most comprehensive photo editor SDK for web and mobile
574
star
4

rembrandt

Image comparison using node-canvas
JavaScript
292
star
5

pesdk-ios-build

PhotoEditor SDK: A fully customizable photo editor for your app.
Swift
152
star
6

vesdk-react-native

React Native module for VideoEditor SDK
TypeScript
144
star
7

vesdk-android-demo

VideoEditor SDK: A fully customizable video editor for your app.
Kotlin
144
star
8

pesdk-html5-build

PhotoEditor SDK: A fully customizable photo editor for your website.
JavaScript
131
star
9

pesdk-react-native

React Native module for PhotoEditor SDK
TypeScript
122
star
10

vesdk-ios-build

VideoEditor SDK: A fully customizable video editor for your app.
Swift
102
star
11

pesdk-react-native-demo

React Native example for PhotoEditor SDK
Java
76
star
12

cesdk-web-examples

Examples Repository for CreativeEditor SDK
CSS
70
star
13

adonis

Adonis ❤️ Aphrodite
JavaScript
43
star
14

video-editor-wasm-react

A Video editor with Wasm and React running entire in the browser, includes simple trimming control and a button to convert the video to a git.
JavaScript
33
star
15

pesdk-wrapper-vuejs

[Deprecated] Vue.js plugin for PhotoEditor SDK
JavaScript
27
star
16

pesdk-flutter

Flutter plugin for PhotoEditor SDK
Swift
27
star
17

ui-design-system-generator

Design & Develop System. Kickstart your sketch project with atomic styles, support for theming and unified naming.
JavaScript
22
star
18

vesdk-flutter

Flutter plugin for VideoEditor SDK
Swift
21
star
19

pesdk-blog-instagram-ui

Code accompanying the 'How to build Instagram's Story Editor in a Day' blog post
Java
19
star
20

vesdk-react-native-demo

React Native example for VideoEditor SDK
JavaScript
17
star
21

catalog-android

A fully customizable photo and video editor for your app.
Kotlin
14
star
22

cesdk-android-examples

Examples repository for running CreativeEngine on Android in Kotlin
Kotlin
14
star
23

IMGLYUI-swift

Fully customizable, simple-to-use design editor
Swift
13
star
24

pesdk-react-demo

[Deprecated] PhotoEditor SDK integration example for ReactJS
JavaScript
10
star
25

pesdk-ionic-demo

Ionic plugin demo for PhotoEditorSDK iOS and Android
TypeScript
9
star
26

imgly-flutter

Flutter plugin for IMG.LY SDK
Dart
9
star
27

catalog-ios

A fully customizable photo and video editor for your app.
Swift
9
star
28

vesdk-ios-examples

A fully customizable video editor for your app.
9
star
29

pesdk-cordova

Cordova & Ionic plugin for PhotoEditor SDK
TypeScript
8
star
30

catalog-react-native

A fully customizable photo and video editor for your app.
TypeScript
8
star
31

pesdk-cordova-demo

Cordova plugin demo for PhotoEditor SDK iOS & Android
Java
8
star
32

catalog-flutter

A fully customizable photo and video editor for your app.
Dart
7
star
33

IMGLYEngine-swift

Fully customizable, simple-to-use design editor
Swift
7
star
34

cesdk-swift-examples

Examples repository for running CE.SDK's CreativeEngine in Swift
Swift
7
star
35

pesdk-angular-demo

[Deprecated]
TypeScript
5
star
36

pesdk-server-build

A fully customizable photo editor for your app.
JavaScript
4
star
37

canva-clone-react-cesdk

This project is a Canva clone built with React and IMG.LY’s CE.SDK, providing a powerful and intuitive design editor for creating invitations, greeting cards, flyers, postcards, and business cards.
CSS
4
star
38

imgly-react-native

React Native base module for PhotoEditor and VideoEditor SDK
JavaScript
3
star
39

vesdk-cordova-demo

Cordova demo for VideoEditorSDK iOS and Android
Java
2
star
40

vesdk-ionic-demo

Ionic plugin demo for VideoEditorSDK iOS and Android
TypeScript
2
star
41

plugins

Plugins enhance the capabilities of CreativeEditor SDK (CE.SDK) by allowing developers to create and integrate custom plugins.
TypeScript
2
star
42

vesdk-cordova

Cordova & Ionic plugin for VideoEditor SDK
TypeScript
2
star
43

cesdk-node-examples

Examples repository for running CE.SDK's CreativeEngine in Node.js
JavaScript
2
star
44

tiktok-clone-ios-cesdk

A TikTok clone built with Swift and IMG.LY's CE.SDK mobile video editor and camera
Swift
2
star
45

pesdk-web-plugins

TypeScript
1
star
46

pesdk-rails-demo

[Deprecated] Ruby on Rails Demo for PhotoEditorSDK HTML5
Ruby
1
star
47

pesdk-web-examples

Examples Repository for PhotoEditor SDK
TypeScript
1
star
48

psd-importer

Import PSD files into the Creative Editor Ecosystem
TypeScript
1
star