Latest 1.0
Homepage https://github.com/levigroker/GRKImageCrop
License Creative Commons Attribution 3.0 Unported License
Platforms ios 7.0, requires ARC
Authors

A UIImage category which provides "visible" pixel cropping capabilities.

A given image can be rectangularly cropped based on calculated insets to "visible" pixels.
Visible pixels are those whose alpha component are greater than or equal to a given alpha
threshold.

Demo

Installing

If you’re using CocoPods it’s as simple as adding this to your
Podfile:

pod 'GRKImageCrop'

otherwise, simply add the contents of the GRKImageCrop subdirectory to your
project.

Documentation

To use, simply import UIImage+GRKImageCrop.h:

#import "UIImage+GRKImageCrop.h"

Then you can use the category to create a cropped image from a given image:

[image cropImageBelowAlphaThreshold:0.0f completion:^(UIImage *croppedImage, NSError *error) {
    if (croppedImage)
    {
        //Use croppedImage
    }
    else
    {
        //Hanlde error
    }
}];

The only expected error would be memory related.

Additional documentation is available in UIImage+GRKImageCrop.h and example usage
can be found in the GRKImageCropTestApp.

Disclaimer and Licence

About

A professional iOS engineer by day, my name is Levi Brown. Authoring a blog
grokin.gs, I am reachable via:

Twitter @levigroker
App.net @levigroker
Email [email protected]

Your constructive comments and feedback are always welcome.

Latest podspec

{
    "name": "GRKImageCrop",
    "version": "1.0",
    "summary": "A UIImage category which provides "visible" pixel cropping capabilities.",
    "description": "A UIImage category which provides "visible" pixel cropping capabilities.nA given image can be rectangularly cropped based on calculated insets to "visible" pixels.nVisible pixels are those whose alpha component are greater than or equal to a given alphanthreshold.n",
    "homepage": "https://github.com/levigroker/GRKImageCrop",
    "license": "Creative Commons Attribution 3.0 Unported License",
    "authors": {
        "Levi Brown": "[email protected]"
    },
    "social_media_url": "https://twitter.com/levigroker",
    "source": {
        "git": "https://github.com/levigroker/GRKImageCrop.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "GRKImageCrop/**/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This