CIFilter filters available for iOS 5

If any of you wondering which filters are available for iOS (Not all filters found in the CIFilter class are available for iOS), here is a list:

  1. CIAdditionCompositing
  2. CIAffineTransform
  3. CICheckerboardGenerator
  4. CIColorBlendMode
  5. CIColorBurnBlendMode
  6. CIColorControls
  7. CIColorCube
  8. CIColorDodgeBlendMode
  9. CIColorInvert
  10. CIColorMatrix
  11. CIColorMonochrome
  12. CIConstantColorGenerator
  13. CICrop
  14. CIDarkenBlendMode
  15. CIDifferenceBlendMode
  16. CIExclusionBlendMode
  17. CIExposureAdjust
  18. CIFalseColor
  19. CIGammaAdjust
  20. CIGaussianGradient
  21. CIHardLightBlendMode
  22. CIHighlightShadowAdjust
  23. CIHueAdjust
  24. CIHueBlendMode
  25. CILightenBlendMode
  26. CILinearGradient
  27. CILuminosityBlendMode
  28. CIMaximumCompositing
  29. CIMinimumCompositing
  30. CIMultiplyBlendMode
  31. CIMultiplyCompositing
  32. CIOverlayBlendMode
  33. CIRadialGradient
  34. CISaturationBlendMode
  35. CIScreenBlendMode
  36. CISepiaTone
  37. CISoftLightBlendMode
  38. CISourceAtopCompositing
  39. CISourceInCompositing
  40. CISourceOutCompositing
  41. CISourceOverCompositing
  42. CIStraightenFilter
  43. CIStripesGenerator
  44. CITemperatureAndTint
  45. CIToneCurve
  46. CIVibrance
  47. CIVignette
  48. CIWhitePointAdjust

You can get this list simply by calling [CIFilter filterNamesInCategories:nil];

You can find the complete reference for each of this filters here

UPDATE:

CIKaleidoscope is also available on iOS although filterNamesInCategories will not return it, but you can’t change any of its properties, you can only use it with its default values.

warning: icon dimensions (0 x 0) don’t meet the size requirements.

I update yesterday my Mac mini to Lion 10.7.3. All went well no problem occurred, no crashing of apps, no artwork error, no CUI error.

But then I wanted to upload an update for my app SQLed, fixing a bug a user pointed out to me.

While trying to upload the update from Xcode I get an error stating
“warning: iPhone/iPod Touch: Icon.png: icon dimensions (0 x 0) don’t meet the size requirements. The icon file must be 57×57 pixels, in .png format (-19014)”
“warning: iPad: Icon-72.png: icon dimensions (0 x 0) don’t meet the size requirements. The icon file must be 72×72 pixels, in .png format (-19014)”.

Cleaning the project wont do anything. Trying to upload an older version will get me the same error.

I googled around a little bit and found a possible solution which stated I should turn of Compression for PNG files in Xcode. I tried that and it worked. I could upload my update without errors.

But that would increase the size of my app and I don’t want that. It used to work with compression on so it should work now too.

So I went to Apples Developer Forums and found a solution that doesn’t need the compression to be turned off.

The Solution is:
Simply download the latest Application Loader from Apple and install it. Then go back to Xcode and upload your app without any issues. Here is the link to the Apple developer forums Link

Update:
There is now an Technical Q&A by Apple acknowledging the problem and proposing the above solution
Link

Applying CIFilter on Image in an UIImageView

In my latest App Filterastic+ I’m using CIFilter which was introduced in iOS 5. CIFilter class allows you to apply a filter to an CIImage. I will show you how you can use CIFilter with an UIImage object and in extend with an UIImageView.

//imgView is the UIImageView I’m using to display an UIImage to the user

//Put it all into an NSAutoreleasePool and release it when you are done or else the memory allocated by CIContext will increase every time you apply a filter
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

//First of all keep a copy of the original image orientation
//you’ll need it afterwards
UIImageOrientation originalOrientation = self.imgView.image.imageOrientation;

//Then you need to create the CIImage from the UIImage
//I used the CGImage property of the UIImage class and created the CIImage from the CGImage
CIImage *inputImage = [[CIImage alloc] initWithCGImage:[self.imgView.image CGImage]];

//Then create the CIFilter you want
//I’m using sepia in this example
CIFilter adjustmentFilter = [CIFilter filterWithName:@”CISepiaTone”];
[adjustmentFilter setDefaults];
[adjustmentFilter setValue:inputImage forKey:@”inputImage”];
[adjustmentFilter setValue:[NSNumber numberWithFloat:1.0f] forKey:@”inputIntensity”];

// The output CIImage with the sepia effect applied
CIImage *outputImage = [adjustmentFilter valueForKey:@”outputImage”];

//Create a CIContext
CIContext* context = [CIContext contextWithOptions:nil];

//Create an CGImageRef from the output CIImage
CGImageRef imgRef = [context createCGImage:outputImage fromRect:outputImage.extent] ;

// Create an UIImage from the CGImageRef object with scale = 1.0 and the orientation of the original image
UIImage* img = [[UIImage alloc] initWithCGImage:imgRef scale:1.0 orientation:originalOrientation];

//Release the CGImageRef object
CGImageRelease(imgRef);

//set the UIImage object to the UIImageView
self.imgView.image = img;

// release stuff
[img release];
[inputImage release];
[pool release];