Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get Image Filters in Core Image framework

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 817
    Comment on it

    Hi Readers!

    Many times we need to check what Core Image filters do we have in iOS framework. Here is a simple code to get all the list of filters with their attributes. This will be easier for you to check and apply any filter on an image. 

    I have passed nil to get all the categories. You can pass other categories displayed in CIFilter.h class

    Example 1: Passing as nil

    NSArray *arr = [CIFilter filterNamesInCategory:nil];
        [arr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            CIFilter *filter = [CIFilter filterWithName:obj];
            NSLog(@"filter properties %@",filter.attributes);
        }];

    Example 2: Passing a category

    NSArray *arr = [CIFilter filterNamesInCategory:kCICategoryDistortionEffect];
        [arr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            CIFilter *filter = [CIFilter filterWithName:obj];
            NSLog(@"filter properties %@",filter.attributes);
        }];

    Hope it helps!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: