All Projects → TakuSemba → Cropme

TakuSemba / Cropme

Licence: apache-2.0
Extremely Smooth and Easy Cropping library for you

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Cropme

Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+1275.82%)
Mutual labels:  image, crop-image, cropper, cropping
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (-30.72%)
Mutual labels:  image, crop-image, cropping
Image Focus
A dependency free utility for cropping images based on a focus point ~2.13kB gzipped
Stars: ✭ 134 (-56.21%)
Mutual labels:  image, cropper, cropping
Rskimagecropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.
Stars: ✭ 2,371 (+674.84%)
Mutual labels:  image, cropper, cropping
Cropiwa
📐 Configurable Custom Crop widget for Android
Stars: ✭ 2,185 (+614.05%)
Mutual labels:  image, crop-image, cropper
Croppr.js
A vanilla JavaScript image cropper that's lightweight, awesome, and has absolutely zero dependencies.
Stars: ✭ 294 (-3.92%)
Mutual labels:  image, cropper
Image Cropper
💯一款功能强大的微信小程序图片裁剪插件
Stars: ✭ 893 (+191.83%)
Mutual labels:  image, cropper
Angular Cropperjs
CropperJS integration for Angular +6
Stars: ✭ 88 (-71.24%)
Mutual labels:  image, cropper
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+149.02%)
Mutual labels:  image, crop-image
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+355.56%)
Mutual labels:  image, crop-image
Croppie
A Javascript Image Cropper
Stars: ✭ 2,330 (+661.44%)
Mutual labels:  image, crop-image
Tiny Site
图片优化
Stars: ✭ 65 (-78.76%)
Mutual labels:  image, crop-image
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-90.52%)
Mutual labels:  image, crop-image
cropimg
Another cropping jQuery plugin
Stars: ✭ 30 (-90.2%)
Mutual labels:  cropper, crop-image
react-simple-crop
✂️ A React component library for cropping and previewing images
Stars: ✭ 19 (-93.79%)
Mutual labels:  cropper, crop-image
react-drop-n-crop
An opinionated implementation of react-dropzone and react-cropper
Stars: ✭ 17 (-94.44%)
Mutual labels:  cropper, crop-image
react-native-avatar-crop
Highly customisable <Crop /> component for React Native < 💅 >
Stars: ✭ 47 (-84.64%)
Mutual labels:  cropper, cropping
React Native Image Crop Picker
iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
Stars: ✭ 5,261 (+1619.28%)
Mutual labels:  image, cropping
Imagepicker
📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera
Stars: ✭ 623 (+103.59%)
Mutual labels:  image, crop-image
Android Imagecropview
android image crop library
Stars: ✭ 225 (-26.47%)
Mutual labels:  image, cropping

CropMe

Gradle

dependencies {
    implementation 'com.github.takusemba:cropme:x.x.x'
}


Usage

Build Status Download License API

This is an Android library for cropping images. Move images smoothly, and crop images precisely.

Use CropView in your xml file.

  <com.takusemba.cropme.CropLayout
    android:id="@+id/crop_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:cropme_background_alpha="80%"
    app:cropme_frame_height_percent="80%"
    app:cropme_frame_width_percent="80%"
    app:cropme_max_scale="2.0"
    app:cropme_overlay_shape="rectangle"
    app:cropme_with_border="true"
    >

Set your image

cropView.setUri(uri);
// or
cropView.setBitmap(bitmap)

Crop it!

cropLayout.addOnCropListener(object : OnCropListener {
  override fun onSuccess(bitmap: Bitmap) {
    // do somethhing with bitmap.
  }

  override fun onFailure(e: Exception) {
    // do error handling.
  }
})
    
cropView.isOffFrame() // optionally check if the image is off the frame.

cropView.crop() // crop image

Attributes

attribute description default
cropme_frame_width_percent width of croppling frame 80%
cropme_frame_height_percent height of croppling frame 80%
cropme_max_scale maximum scale while cropping 2.0
cropme_with_border if borders are shown while cropping true
cropme_background_alpha background alpha out side of cropping area 80%
cropme_overlay_shape shape of croppling frame rectangle / circle / custom
cropme_custom_shape_layout custom layout for custom shape @layout/custom_layout

Custom Overlay

If you want to show a custom overlay, you can customize the Overlay by extending CropOverlay.

You can see more detail in app module.

class CustomCropOverlay @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0,
    cropOverlayAttrs: AttributeSet? = attrs
) : CropOverlay(context, attrs, defStyleAttr, cropOverlayAttrs) {

  override fun drawBackground(canvas: Canvas, paint: Paint) {
    // draw background
  }

  override fun drawCrop(canvas: Canvas, paint: Paint) {
    // draw croppling frame
  }

  override fun drawBorder(canvas: Canvas, paint: Paint) {
    // draw borders
  }
}

Sample

Clone this repo and check out the app module.

Author

Licence

Copyright 2017 Taku Semba.

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

   http://www.apache.org/licenses/LICENSE-2.0

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].