Skip to content

Crop the image to specified size, and automatically detect any human face in the image to prevent cropping out any face.

Notifications You must be signed in to change notification settings

syshen/UIImage-FaceFirst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

With FaceFirst UIImage category, you can crop and resize an image to a specific size and it will try not to crop out any face showing in the image. For a group shot, it will pick only one of faces as base. For any other image without any human face, it will not take any effect, just resize and crop to the size you sepecify.

You can combine this category with UIImageView together to show any image with faces properly.

How To Use

  • Drag and drop UIImage+FaceFirst.h and UIImage+FaceFirst.m into your XCode project.

  • Include CoreImage.framework in the libraries your project is linking to.

  • Use the following sample in your code:

    self.imageView.image = [[UIImage imageNamed:@"yourimage"] faceFirstImageScaledToFillSize:self.imageView.frame.size];

Basic Requirements

  • iOS5: since it is using CIDetector feature in iOS5, it requires at least iOS5
  • ARC

Samples

About

Crop the image to specified size, and automatically detect any human face in the image to prevent cropping out any face.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published