Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6937151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:19:34+00:00 2026-05-27T12:19:34+00:00

I am trying to process image using Core Image. I have created UIImage category

  • 0

I am trying to process image using Core Image. I have created UIImage category to do it.

I have added QuartzCore and CoreImage frameworks to project, imported CoreImage/CoreImage.h and used this code:

CIImage *inputImage = self.CIImage;
CIFilter *exposureAdjustmentFilter = [CIFilter filterWithName:@"CIExposureAdjust"];
[exposureAdjustmentFilter setDefaults];
[exposureAdjustmentFilter setValue:inputImage forKey:@"inputImage"];
[exposureAdjustmentFilter setValue:[NSNumber numberWithFloat:5.0f] forKey:@"inputEV"];
CIImage *outputImage = [exposureAdjustmentFilter valueForKey:@"outputImage"];
CIContext *myContext = [CIContext contextWithOptions:nil];

return [UIImage imageWithCGImage:[myContext createCGImage:outputImage fromRect:outputImage.extent]];

But I have got nil output image from the filter.

I have also tried to use CIHueAdjust with the same result.

Than you in advance

UPDATE: I have found solution. It was necessary to alloc new CIImage, not only pass reference to UIImage.CIImage this way:

CIImage *inputImage = [[CIImage alloc] initWithImage:self];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:19:35+00:00Added an answer on May 27, 2026 at 12:19 pm

    Try following code:-

     CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"old-country-rain.jpg"]];
    CIFilter * controlsFilter = [CIFilter filterWithName:@"CIExposureAdjust"];
    [controlsFilter setValue:inputImage forKey:kCIInputImageKey];
    [controlsFilter setValue:[NSNumber numberWithFloat: 2.0f] forKey:@"inputEV"];
    NSLog(@"%@",controlsFilter.attributes);
    CIImage *displayImage = controlsFilter.outputImage;
    UIImage *finalImage = [UIImage imageWithCIImage:displayImage];
    
    CIContext *context = [CIContext contextWithOptions:nil];
    if (displayImage == nil || finalImage == nil) {
        // We did not get output image. Let's display the original image itself.
        imageView.image = [UIImage imageNamed:@"old-country-rain.jpg"];
    }else {
        // We got output image. Display it.
        imageView.image = [UIImage imageWithCGImage:[context createCGImage:displayImage fromRect:displayImage.extent]];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already implemented multitouch image rotation using standard iOS graphics library (Core Graphics).
I am trying to process an externally hosted image using a php command. Here
I'm trying to process an image using ABBYY OCR SDK using the sample code
I am trying to process an uploaded file in a Perl program, using CGI::Application.
I am trying to process a dimension using SQL Server 2005 Analysis Services .
I am trying to save out a large image from flash using bitmapdata and
I'm trying to implement a JQuery script to process some areas inside an image
I have a Scrapy project and I am trying to save the output items
I am trying to use image_magick gem to process image uploads, but rails can't
I am trying to quickly process large images (about 2000x2000). I am using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.