Android Image Cropper

Image Cropping Library for Android, optimized for Camera / Gallery.
Under Apache License 2.0
By ArthurHub

android android-image-cropper cropper

Android Image Cropper

Powerful (Zoom, Rotation, Multi-Source), customizable (Shape, Limits, Style), optimized (Async, Sampling, Matrix) and simple image cropping library for Android.


For a working implementation, please have a look at the Sample Project

See GitHub Wiki for more info.

  1. Include the library

dependencies {
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'

Add permissions to manifest

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Add this line to your Proguard config file

-keep class androidx.appcompat.widget.** { *; }

Using Activity

  1. Add CropImageActivity into your AndroidManifest.xml
    <activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
    android:theme="@style/Base.Theme.AppCompat"/> <!-- optional (needed if default theme has no action bar) -->

  2. Start CropImageActivity using builder pattern from your activity
    // start picker to get image for cropping and then use the image in cropping activity

// start cropping activity for pre-acquired image saved on the device

// for fragment (DO NOT use getActivity())
.start(getContext(), this);

  1. Override onActivityResult method in your activity to get crop result
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
    CropImage.ActivityResult result = CropImage.getActivityResult(data);
    if (resultCode == RESULT_OK) {
    Uri resultUri = result.getUri();
    } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {
    Exception error = result.getError();

Using View

  1. Add CropImageView into your activity


  1. Set image to crop
    // or (prefer using uri for performance and better user experience)

  2. Get cropped image
    // subscribe to async event using cropImageView.setOnCropImageCompleteListener(listener)
    // or
    Bitmap cropped = cropImageView.getCroppedImage();



For more information, see the GitHub Wiki.


Change log

- Fix crash on Android O (thx @juliooa)
- Update to support library to AndroidX (thx @mradzinski)
- Handle failure when selecting non image file (thx @uncledoc)
- More translations (thx @jkwiecien, @david-serrano)

- Update gradle wrapper to 4.4
- Update support library to 27.1.1 and set is statically! (thx @androideveloper)
- Fix NPE in activity creation by tools (thx @unverbraucht)
- More translations (thx @gwharvey, @dlackty, @JairoGeek, @shaymargolis)

See full change log.


Originally forked from edmodo/cropper.

Copyright 2016, Arthur Teplitzki, 2013, Edmodo, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.