Latest 1.0.1
License MIT
Platforms ios 5.0, requires ARC
Frameworks QuartzCore, CoreGraphics, CoreImage

HTCoreImage is a collection of convenience categories for Core Image. There are convenience constructors for every filter, annotated with NS_AVAILABLE_SINCE() macros so you know what’s in iOS 5 vs iOS 6.

Example: Let’s increase the contrast on an image and colorize it blue:

    UIImage *sourceUIImage = [UIImage imageNamed:@"asdf"];

    [[[sourceUIImage toCIImage] imageByApplyingFilters:@[
      [CIFilter filterColorControlsSaturation:1 brightness:1 contrast:2],
      [CIFilter filterColorMatrixWithRed:0.5 green:0.5 blue:1 alpha:1]]]
     processToUIImageCompletion:^(UIImage *uiImage) {
        NSLog(@"%@", uiImage);

Here’s the same thing with stock Core Image for comparison:

    UIImage *sourceUIImage = [UIImage imageNamed:@"asdf"];

    CIImage *sourceCIImage = [CIImage imageWithCGImage:sourceUIImage.CGImage];

    CIFilter *colorControlsFilter = [CIFilter filterWithName:@"CIColorControls"];
    [colorControlsFilter setDefaults];
    [colorControlsFilter setValue:@(1) forKey:@"inputSaturation"];
    [colorControlsFilter setValue:@(1) forKey:@"inputBrightness"];
    [colorControlsFilter setValue:@(2) forKey:@"inputContrast"];
    [colorControlsFilter setInputCIImage:sourceCIImage];

    CIFilter *colorMatrixFilter = [CIFilter filterWithName:@"CIColorMatrix"];
    [colorMatrixFilter setDefaults];
    [colorMatrixFilter setValue:[CIVector vectorWithX:0.5 Y:0 Z:0 W:0]
    [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0.5 Z:0 W:0]
    [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0 Z:1 W:0]
    [colorMatrixFilter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:1]
    [colorMatrixFilter setInputCIImage:[colorControlsFilter outputImage]];

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
                       CIContext *ciContext = [CIContext contextWithOptions:@{ kCIContextUseSoftwareRenderer : (id)kCFBooleanFalse }];
                       CGImageRef resultCGImage = [ciContext createCGImage:[colorMatrixFilter outputImage] fromRect:[[colorMatrixFilter outputImage] extent]];
                       UIImage *resultUIImage = [UIImage imageWithCGImage:resultCGImage scale:sourceUIImage.scale orientation:sourceUIImage.imageOrientation];
                       dispatch_async(dispatch_get_main_queue(), ^
                                          NSLog(@"%@", resultUIImage);


The recommended installation method is cocoapods. Add this line to your Podfile:

pod 'HTCoreImage'

Contributions welcome!

Use it? Love/hate it?

Tweet the author @jakejennings, and check out HotelTonight’s engineering blog:

Also, check out HotelTonight’s other iOS open source:

Latest podspec

    "name": "HTCoreImage",
    "version": "1.0.1",
    "platforms": {
        "ios": "5.0"
    "summary": "A set of convenience categories to simplify use of Core Image on iOS.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Jacob Jennings": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.1"
    "source_files": [
    "frameworks": [
    "requires_arc": true

Pin It on Pinterest

Share This