pesdk-android-demo

pesdk-android-demo

Android照片编辑SDK示例 提供多种滤镜和编辑工具

pesdk-android-demo展示了Android照片编辑SDK的功能。该项目包含60多种滤镜、叠加、调整、变换等编辑工具,支持自定义界面和模块。SDK具有高性能,可实时预览高分辨率图片,支持非破坏性编辑,适用于Android 5.0+。开发者可以轻松集成这个灵活的照片编辑方案。

PhotoEditor SDKAndroid图像编辑滤镜UI定制Github开源项目
<!-- ------------------------------------------------------- --| |-- ------------------------------------------------------- --| |-- ----This file is automatically generated by grovvy.---- --| |-- Do not modify this file -- YOUR CHANGES WILL BE ERASED! --| |-- ------------------------------------------------------- --| |-- ------------------------------------------------------- --> <p align="center"> <a target="_blank" href="https://img.ly/photo-sdk/?utm_campaign=Projects&utm_source=Github&utm_medium=PESDK&utm_content=Android&utm_term=Android"><img src="https://img.ly/static/logos/PE.SDK_Logo.svg" alt="PhotoEditor SDK Logo"/></a> </p> <p align="center"> <a href="http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels"> <img src="https://img.shields.io/badge/MIN_SDK-21-B8D529.svg?style=flat"> <img src="https://img.shields.io/badge/BUILD_SDK-31-92D230.svg?style=flat"> </a> <a href="https://img.ly/docs/pesdk/android/introduction/getting_started"> <img src="https://img.shields.io/badge/platform-android-2DC25C.svg?style=flat"> </a> <a href="https://artifactory.img.ly/artifactory/imgly/ly/img/android/pesdk/"> <img src="https://img.shields.io/badge/VERSION-10.7.3-007ec6.svg?style=flat" alt="Maven"> </a> <a href="http://twitter.com/PhotoEditorSDK"> <img src="https://img.shields.io/badge/twitter-@PhotoEditorSDK-8646E2.svg?style=flat" alt="Twitter"> </a> </p>

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.

<a href="https://play.google.com/store/apps/details?id=com.photoeditorsdk.android.app&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"> <img height="60" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge-border.png" > </a>

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 <br/> 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 <br/> The PhotoEditor core library for Android. Containing the OpenGL and toolkit implementation.

UI Component <br/> 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.8.2' classpath("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.6.21-1.0.6") } }

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' apply plugin: 'com.google.devtools.ksp' // 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) {

编辑推荐精选

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI助手AI工具AI写作工具AI辅助写作蛙蛙写作学术助手办公助手营销助手
Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

聊天机器人AI助手热门AI工具AI对话
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

热门AI工具AI办公办公工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

模型训练热门AI工具内容创作智能问答AI开发讯飞星火大模型多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

AI助手热门AI工具AI创作AI辅助写作讯飞绘文内容运营个性化文章多平台分发
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多