Blur UIImage on finger touch and move for iOS / iPhone

Today I have managed to blur an image by using finger inputs which is placed on a UIImageView on iOS.  I know it is not the best but the consequence was a great success.  I used a box-blur algorithm that I have came up with today earlier.  It is actually not a big deal to implement such algorithm but to make it high performance is.  Mine is not slow but is not super fast either.  I am not allowed to share such code but I can basically write about the steps;

  1. Get users finger’s touch coordinates.  Be careful here if you are using retina display you need to multiply coordinates by 2 to get actual coordinates thats the trick here.
  2. Take that position as your center point and go up and left to find your rectangle’s starting point.  (There are a lot of if checks here)
  3. Create a rectangle starting from that point and crop that part of the image into another UIImage.
  4. Blur that small piece of square with whatever algorithm you are using. (I have used box-blur, much faster than gaussian)
  5. Paste that small piece to the same place where you have taken it from.
  6. There you have blurred a part of an image, if you put this function in TouchesMoved function then you can get good results as I have.

Those are the steps I have followed while implementing my own.  If you are not good with Maths then you should not try to do this on your own, it would take a long time to figure out what to sum or multiply.  There are a lot of operations which drive you crazy sometimes.

It’s been a long time

It’s been a long time since my last post.  It actually seems like this is my first post but it is not.  Thanks to my hosting and domain provider, there has been a malfunction at one of their servers which unfortunately was hosting my database and they have lost all the data.  I did not have a backup back then but I should have.  I dedcided to backup my data from time to time both local and online.  I try posting regularly but it never happens, whatever don’t wanna jinx it.