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 7710913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:14:33+00:00 2026-06-01T01:14:33+00:00

how i apply CIToneCurve filter i applied filter= [CIFilter filterWithName:@CIScreenBlendMode]; [filter setValue:beginImage1 forKey:kCIInputImageKey]; [filter

  • 0

how i apply CIToneCurve filter i applied

  filter= [CIFilter filterWithName:@"CIScreenBlendMode"];
     [filter setValue:beginImage1 forKey:kCIInputImageKey];
     [filter setValue:beginImage forKey:@"inputBackgroundImage"];

different filters with this approach now i want to apply CIToneCurve how should i apply this with these parameters

inputImage
A CIImage class whose display name is Image.

inputPoint0
A CIVector class whose attribute type is CIAttributeTypeOffset and whose display name is Point 1. Default value: [0, 0] Identity: [0, 0]

inputPoint1
A CIVector class whose attribute type is CIAttributeTypeOffset and whose display name is Point 2l. Default value: [0.25, 0.25] Identity: [0.25, 0.25]

inputPoint2
A CIVector class whose attribute type is CIAttributeTypeOffset and whose display name is Point 3l. Default value: [0.5, 0.5] Identity: [0.5, 0.5]

inputPoint3
A CIVector class whose attribute type is CIAttributeTypeOffset and whose display name is Point 4. Default value: [0.75, 0.75] Identity: [0.75, 0.75]

inputPoint4
A CIVector class whose attribute type is CIAttributeTypeOffset and whose display name is Point 5. Default value: [1, 1] Identity: [1, 1]

i write these but my app crash with out giving any error

  • 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-06-01T01:14:34+00:00Added an answer on June 1, 2026 at 1:14 am

    each filter accepts different kind of parameters but once you get use to them is pretty easy.
    You didn’t post what error you are getting but this works for me:

    - (void)doCIToneCurveFilter
    {
        // Set an appropriate image. A bit dark so we see the results clearer
        // This image is being taken from http://photo.tutsplus.com/tutorials/post-processing/adobe-camera-raw-for-beginners-tone-curve/
        imageView.image = [UIImage imageNamed:@"turtles"];
        imageView.frame = CGRectMake(0, 0, imageView.image.size.width*0.7, imageView.image.size.height*0.7); // shrank this a bit 2 images fit on screen
    
        // Make the input image recipe
        CIImage *inputImage = [CIImage imageWithCGImage:imageView.image.CGImage];
    
        // Make tone filter filter
        // See mentioned link for visual reference
        CIFilter *toneCurveFilter = [CIFilter filterWithName:@"CIToneCurve"];
        [toneCurveFilter setDefaults];
        [toneCurveFilter setValue:inputImage forKey:kCIInputImageKey];
        [toneCurveFilter setValue:[CIVector vectorWithX:0.0  Y:0.0] forKey:@"inputPoint0"]; // default
        [toneCurveFilter setValue:[CIVector vectorWithX:0.27 Y:0.26] forKey:@"inputPoint1"]; 
        [toneCurveFilter setValue:[CIVector vectorWithX:0.5  Y:0.80] forKey:@"inputPoint2"];
        [toneCurveFilter setValue:[CIVector vectorWithX:0.7  Y:1.0] forKey:@"inputPoint3"];
        [toneCurveFilter setValue:[CIVector vectorWithX:1.0  Y:1.0] forKey:@"inputPoint4"]; // default
    
        // Get the output image recipe
        CIImage *outputImage = [toneCurveFilter outputImage];
    
        // Create the context and instruct CoreImage to draw the output image recipe into a CGImage
        CIContext *context = [CIContext contextWithOptions:nil];
        CGImageRef cgimg = [context createCGImage:outputImage fromRect:[outputImage extent]];
    
        // Draw the image in screen
        UIImageView *imageView2 = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:cgimg]];
        CGRect f = imageView2.frame;
        f.origin.y = CGRectGetMaxY(imageView.frame);
        f.size.width = imageView.frame.size.width;
        f.size.height = imageView.frame.size.height;
        imageView2.frame = f;
    
        [self.view addSubview:imageView2];
    }
    

    And this is the result:

    Result CIToneCurve

    The image I used was taken from here and there you can find the curve I approximated in this example:

    curve

    PS: If you are wondering why the my result image does not look exactly the same as the result in the link it is because my image is a partial image and color distribution is different. Alike but not exactly the same. So applying exactly the same curve will not give the exactly same result.

    I hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apply a filter to Dataview and after that I need to get the
How to apply different touch animations in one application like(drag,single touch,multiple touch and others).
I want to apply an XSLT Stylesheet to an XML Document using C# and
This question would probably apply equally as well to other languages with C-like multi-line
I am trying to apply styles to HTML tags dynamically by reading in the
How do I apply the MarshalAsAttribute to the return type of the code below?
How do I apply 'use base' in Perl to inherit subs from some base
I'm trying to apply a transform to a 3D object in a STL File
I need to apply some xml templates to various streams of xml data (and
when I apply the tag above my methods I get the error Type System.Runtime.CompilerServices.Extension

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.