Sometimes for file size optimization or just for making an image to fit a specific image view, a lot of applications need to handle the image cropping feature. This, unlike other implementation of widgets, can be pretty easy using a third party library.
In this top, we'll share with you 10 of the most imponent libraries to build image croppers in your native android application.
10. CropperNoCropper
This is a lightweight Image Cropper for Android which also supports no-crop feature. It's a FrameLayout which contains a view for Grid and an imageview. This project supports only square cropping. CropperView contains some basic methods like setImageBitmap()
, setMaxZoom()
, setMinZoom()
, etc which are forwarded to CropperImageView
.
It's not an Activity or Fragment. It's just a FrameLayout which you can use anywhere and however you want in your app. There are some styling and customizations also available.
9. CropView
Cropview is an android image cropping library.
8. CropMe
This is an Android library for cropping images. Move images smoothly, and crop images precisely. If you want to show circle overlay or anything else, you can customize the Overlay by extending CropOverlay. SquareCropOverlay is provided by default.
7. PhotoCropper
The Ultimate Approach to crop photos on android devices, especially for large size photos. This way can help you avoid OOM(OutOfMemory) exception. PhotoCropper is a light-weight but sharp and smart tool to help you cropping photos on android devices. By providing a simple callback interface for developers and encapsulating the tricky things of cropping photos into a library. It makes the logic much more easier and simpler.
6. Scissors
Fixed viewport image cropping library for Android with built-in support for Picasso, Glide or Universal Image Loader. This library has been written by the guys at Lyft. Scissors comes with handy extensions which help with common tasks like, Loading a Bitmap and cropping into a file.
5. Cropiwa
Cropiwa is a configurable Custom Crop widget for Android. The library is a highly configurable widget for image cropping. The library has a modular architecture, which makes it highly configurable. One of the useful features is that you don't have to wait for a result - after crop request is done, simply switch to another screen and wait for the result in a form of broadcast.
4. SimpleCropView
The SimpleCropView is an image cropping library for Android. It simplifies your code for cropping image and provides an easily customizable UI. Supported on API Level 14 and above. The image is scaled to fit the size of the view by maintaining the aspect ratio. WRAP_CONTENT
will be ignored.
3. Android Crop
Android Crop is an android library project for cropping images. It features:
- Gradle build & AAR
- Modern UI
- Backwards compatible to SDK 10
- Simple builder for configuration
- Example project
2. Android Image Cropper
Android Image Cropper is a powerful (Zoom, Rotation, Multi-Source), customizable (Shape, Limits, Style), optimized (Async, Sampling, Matrix) and simple image cropping library for Android.
The resulting cropped image is always rectangular simply because bitmaps are. Usually, the oval shape is created during rendering of the image, there are many solutions for it. But if you do want the resulting image pixels to reflect the oval shape you can use CropImage.toOvalBitmap(Bitmap)
helper method that does exactly that.
1. uCrop
uCrops is an image Cropping Library for Android. uCrop builder class has method withOptions(UCrop.Options options)
which extends library configurations. Currently you can change:
- image compression format (e.g. PNG, JPEG, WEBP), compression
- image compression quality [0 - 100]. PNG which is lossless, will ignore the quality setting.
- whether all gestures are enabled simultaneously
- maximum size for Bitmap that is decoded from source Uri and used within crop view. If you want to override default behaviour.
- toggle whether to show crop frame/guidelines
- setup color/width/count of crop frame/rows/columns
- choose whether you want rectangle or oval crop area
- the UI colors (Toolbar, StatusBar, active widget state)
- and more.
It offers the following compatibility:
- Library - Android ICS 4.0+ (API 14) (Android GINGERBREAD 2.3+ (API 10) for versions <= 1.3.2)
- Sample - Android ICS 4.0+ (API 14)
- CPU - armeabi armeabi-v7a x86 x86_64 arm64-v8a (for versions >= 2.1.2)
Honorable mentions
Croperino
Supported SDK and Gradle Version:
- Minimum SDK Version 14
- Target SDK Version 28
- Gradle 3.2.1
Features:
- Camera and/or gallery calls.
- Face recoginition
- Cropping of Image based on Scale (Aspect Ratio)
- Customizing button and background
- Performance and compression improvements
CookieCutter
Android library to crop images by moving & scaling image.
If you know another awesome open source Image Cropping widget for Android, please share it with the community in the comment box.