Image Procesing Sharpness on UIImageView with a Slider

Discussion in 'iOS Programming' started by rickjackson, May 18, 2011.

  1. rickjackson macrumors newbie

    Dec 24, 2010
    Hello to all,

    I am new to iPhone Development and even new to Image Processing but guyz i all of your help I am learning Image Processing in Bits and Pieces What i have learned so far is that how can i obtain the Actual pixel data from CGImage object and how to create a new modified image here is the code :

        CGImageRef sourceImage = theImage.image.CGImage;
        CFDataRef theData;
        theData = CGDataProviderCopyData(CGImageGetDataProvider(sourceImage));
        UInt8 *pixelData = (UInt8 *) CFDataGetBytePtr(theData);
        int dataLength = CFDataGetLength(theData);
    But right now i am struck at a point how can i increase/Decrease the sharpness of UIIMageView With a Slider.

    Please share your thoughts with us so it will benefit all of us in someway.........

  2. dantastic macrumors 6502a


    Jan 21, 2011
    Have a look at the sample project GLImageProcessing. I think it has what you are after.
  3. rickjackson, May 19, 2011
    Last edited: May 19, 2011

    rickjackson thread starter macrumors newbie

    Dec 24, 2010
    Hello Dantastic thanks for your reply........

    Since i have not worked on OpenGL so its hard to understand that code but i have found this article which explains about image processing but not in detail here is the link if any 1 points me to some algorithm for brightness, saturation, hur, sharpness and contrast then it will be very good.
  4. dantastic macrumors 6502a


    Jan 21, 2011
    If it's core image you want to use have a look at the Documentation. There are a few methods there to sharpen and blur an image. Pick the one that would suit your needs.

    I suggest retaining the original image at slider mid point and when values are at the lower end of the slider use a blur function and at the higher end a sharpening function. make sure to always use the original image so you don't compound the effects.
  5. rickjackson thread starter macrumors newbie

    Dec 24, 2010
    Hello Dantastic I have found information about Core Image and its not available in iPhone check this link out :
  6. xStep macrumors 68000

    Jan 28, 2003
    Less lost in L.A.
    CGImages are Immutable, With Exceptions?

    That link is interesting. The guy is changing a CGImage when Apple says that CGImages are immutable; here and here. I suppose since he isn't actually displaying the input image that it might be safe, but I wonder if it would have been safer to do the change by writing the altered bytes into a new image buffer that CGBitmapContextCreate() could have created for him which is rather quick. Can someone with more CG experience shed some further opinion on this please?

    Regarding the rest. A verbal discussion I was in lately suggested that since Apple doesn't supply Core Image in iOS, that you're on your own to create or find a library that does those things. In my case, I'm looking for methods to feather CG strokes in realtime.

Share This Page