RSKImageCropper alternatives and similar libraries
Based on the "Image" category.
Alternatively, view RSKImageCropper alternatives based on common mentions on social networks and blogs.
-
TOCropViewController
A view controller for iOS that allows users to crop portions of UIImage objects -
GPUImage2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
IDMPhotoBrowser
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more -
SKPhotoBrowser
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift -
AspectFillFaceAware
DISCONTINUED. An extension that gives UIImageView the ability to focus on faces within an image. -
GPUImage3
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal. -
Twitter Image Pipline
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients -
EBPhotoPages
A photo gallery for iOS with a modern feature set. Similar features as the Facebook photo browser. -
ImagePickerSheetController
ImagePickerSheetController replicates the custom photo action sheet in iMessage. -
YUCIHighPassSkinSmoothing
An implementation of High Pass Skin Smoothing using Apple's Core Image Framework -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
OnlyPictures
A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility. -
AXPhotoViewer
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos. -
ComplimentaryGradientView
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js -
JLStickerTextView
add text(multiple line support) to imageView, edit, rotate or resize them as you want, then render the text on image
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RSKImageCropper or a related project?
README
RSKImageCropper
An image cropper for iOS like in the Contacts app with support for landscape orientation.
Installation
RSKImageCropper requires iOS 9.0 or later.
Using Swift Package Manager
To add the
RSKImageCropper
package to your Xcode project, select File > Swift Packages > Add Package Dependency and enter the repository URL.https://github.com/ruslanskorb/RSKImageCropper.git
Using CocoaPods
Add the pod
RSKImageCropper
to your Podfile.pod 'RSKImageCropper'
Run
pod install
from Terminal, then open your app's.xcworkspace
file to launch Xcode.Import the
RSKImageCropper.h
header. Typically, this should be written as#import <RSKImageCropper/RSKImageCropper.h>
Using Carthage
Add the
ruslanskorb/RSKImageCropper
project to your Cartfile.github "ruslanskorb/RSKImageCropper"
Run
carthage update
, then follow the additional steps required to add the iOS and/or Mac frameworks into your project.Import the RSKImageCropper framework/module.
- Using Modules:
@import RSKImageCropper
- Without Modules:
#import <RSKImageCropper/RSKImageCropper.h>
- Using Modules:
Basic Usage
Import the class header.
#import <RSKImageCropper/RSKImageCropper.h>
Just create a view controller for image cropping and set the delegate.
- (IBAction)onButtonTouch:(UIButton *)sender
{
UIImage *image = [UIImage imageNamed:@"image"];
RSKImageCropViewController *imageCropVC = [[RSKImageCropViewController alloc] initWithImage:image];
imageCropVC.delegate = self;
[self.navigationController pushViewController:imageCropVC animated:YES];
}
Delegate
RSKImageCropViewControllerDelegate
provides three delegate methods. To use them, implement the delegate in your view controller.
@interface ViewController () <RSKImageCropViewControllerDelegate>
Then implement the delegate functions.
// Crop image has been canceled.
- (void)imageCropViewControllerDidCancelCrop:(RSKImageCropViewController *)controller
{
[self.navigationController popViewControllerAnimated:YES];
}
// The original image has been cropped. Additionally provides a rotation angle used to produce image.
- (void)imageCropViewController:(RSKImageCropViewController *)controller
didCropImage:(UIImage *)croppedImage
usingCropRect:(CGRect)cropRect
rotationAngle:(CGFloat)rotationAngle
{
self.imageView.image = croppedImage;
[self.navigationController popViewControllerAnimated:YES];
}
// The original image will be cropped.
- (void)imageCropViewController:(RSKImageCropViewController *)controller
willCropImage:(UIImage *)originalImage
{
// Use when `applyMaskToCroppedImage` set to YES.
[SVProgressHUD show];
}
DataSource
RSKImageCropViewControllerDataSource
provides three data source methods. The method imageCropViewControllerCustomMaskRect:
asks the data source a custom rect for the mask. The method imageCropViewControllerCustomMaskPath:
asks the data source a custom path for the mask. The method imageCropViewControllerCustomMovementRect:
asks the data source a custom rect in which the image can be moved. To use them, implement the data source in your view controller.
@interface ViewController () <RSKImageCropViewControllerDataSource>
Then implement the data source functions.
// Returns a custom rect for the mask.
- (CGRect)imageCropViewControllerCustomMaskRect:(RSKImageCropViewController *)controller
{
CGSize aspectRatio = CGSizeMake(16.0f, 9.0f);
CGFloat viewWidth = CGRectGetWidth(controller.view.frame);
CGFloat viewHeight = CGRectGetHeight(controller.view.frame);
CGFloat maskWidth;
if ([controller isPortraitInterfaceOrientation]) {
maskWidth = viewWidth;
} else {
maskWidth = viewHeight;
}
CGFloat maskHeight;
do {
maskHeight = maskWidth * aspectRatio.height / aspectRatio.width;
maskWidth -= 1.0f;
} while (maskHeight != floor(maskHeight));
maskWidth += 1.0f;
CGSize maskSize = CGSizeMake(maskWidth, maskHeight);
CGRect maskRect = CGRectMake((viewWidth - maskSize.width) * 0.5f,
(viewHeight - maskSize.height) * 0.5f,
maskSize.width,
maskSize.height);
return maskRect;
}
// Returns a custom path for the mask.
- (UIBezierPath *)imageCropViewControllerCustomMaskPath:(RSKImageCropViewController *)controller
{
CGRect rect = controller.maskRect;
CGPoint point1 = CGPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect));
CGPoint point2 = CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect));
CGPoint point3 = CGPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect));
CGPoint point4 = CGPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect));
UIBezierPath *rectangle = [UIBezierPath bezierPath];
[rectangle moveToPoint:point1];
[rectangle addLineToPoint:point2];
[rectangle addLineToPoint:point3];
[rectangle addLineToPoint:point4];
[rectangle closePath];
return rectangle;
}
// Returns a custom rect in which the image can be moved.
- (CGRect)imageCropViewControllerCustomMovementRect:(RSKImageCropViewController *)controller
{
if (controller.rotationAngle == 0) {
return controller.maskRect;
} else {
CGRect maskRect = controller.maskRect;
CGFloat rotationAngle = controller.rotationAngle;
CGRect movementRect = CGRectZero;
movementRect.size.width = CGRectGetWidth(maskRect) * fabs(cos(rotationAngle)) + CGRectGetHeight(maskRect) * fabs(sin(rotationAngle));
movementRect.size.height = CGRectGetHeight(maskRect) * fabs(cos(rotationAngle)) + CGRectGetWidth(maskRect) * fabs(sin(rotationAngle));
movementRect.origin.x = CGRectGetMinX(maskRect) + (CGRectGetWidth(maskRect) - CGRectGetWidth(movementRect)) * 0.5f;
movementRect.origin.y = CGRectGetMinY(maskRect) + (CGRectGetHeight(maskRect) - CGRectGetHeight(movementRect)) * 0.5f;
movementRect.origin.x = floor(CGRectGetMinX(movementRect));
movementRect.origin.y = floor(CGRectGetMinY(movementRect));
movementRect = CGRectIntegral(movementRect);
return movementRect;
}
}
Coming Soon
- If you would like to request a new feature, feel free to raise as an issue.
Demo
Build and run the RSKImageCropperExample
project in Xcode to see RSKImageCropper
in action.
Have fun. Fork and send pull requests. Figure out hooks for customization.
Contact
Ruslan Skorb
License
This project is is available under the MIT license. See the LICENSE file for more info. Attribution by linking to the project page is appreciated.
*Note that all licence references and agreements mentioned in the RSKImageCropper README section above
are relevant to that project's source code only.