Cut/Slice UiImage using coordinations - iphone

I have an image that I want to slice like the photoshop knife tool using two or more coordinations on the image. I then want to erase the top portion of the image and replace it with a transparent background. If anyone can point me in the right direction or has code that can do it I would be forever grateful.

I think that you should try using a UIGraphicsContext. Here is a similar question, I hope it helps.
Slicing up a UIImage on iPhone

Related

Pasting an image on top of another image

I have this poster image:
I have to blend it with another image. I have to put this image on a picture of a building like this:
The rotated poster image has white pixels that I don't know how to get rid of.
Can someone please help me with code to paste this image on the building image? The front of the building.
Firstly find the four corner points of building where you want to blend image. Also find four corner points of your poster. Then use perspective transform and warpaffine to paste poster on image.
This http://www.learnopencv.com/homography-examples-using-opencv-python-c/ link may help you to get the idea but it is using OpenCV.
I have tried this using OpenCV C++ and I am getting following image after applying perspective transform. Let me know if you want this kind of results:

Is there any way to find exact boundaries of an image in cocos2d instead of making a rect of that image?

I want to cut a part of large image with the shape of a small image. Is there any way to find the exact shape of small image instead of making rect of that image using boundingBox? Please reply..
You could do it by masking the bigger sprite with the smaller one.
Here you have a great tutorial on that:
http://www.raywenderlich.com/4421/how-to-mask-a-sprite-with-cocos2d-1-0
And here is the tool that they use to play with the blending functions
http://www.andersriggelsen.dk/glblendfunc.php

Fade Image to Transparent in iOS

I am just starting out with iOS development. I'm trying to determine if this is possible in iOS and I'm new enough that I don't know what to search for, so please excuse my ignorance.
I'm going to be saving a few images in the application and the primary image will fade over another image like so:
Image A will still need to be a solid image, so my question "Is it possible to create a gradient mask that only fades for 50px from the bottom (transparent) of an image?"
Sorry if this is a basic question and since I don't know where to start I don't have any code to request help on. Any help would be appreciated! :)
Yes, it is definitely possible.
You will need to draw the images in a CGContext. Basically you would first draw image b first then draw image 'a' with an alpha mask using CGImageCreateWithMask.
It is very straight forward. See here for an example.

Show photo with SCRATCH OUT EFFECT by finger

I need your help to know how to create an iPhone application to show a photo with SCRATCH OUT EFFECT.
Something like the effect in this flash tutorial
http://www.tutorial5.com/content/view/115/46/
Please help.
Thanks.
You can have a look at the following post on how to create a blurred image effect, I don't think it's the best & fasted method, but it might get you started:
UIImage blur
You can implement the scratch out effect by using CoreGraphics.
Subclass UIView for the scratchable image.
Draw the scratchable image, use a mask to cut out the parts of the image that gets "scratched".
Each time the user scratches the image, make it so the mask and the image gets updated.
Full code example on github

How to implement image masking

IN scrolllview there is one image with zooming facility.And behind the scrollview there is round image.now i want to masking.I have tried but not working.Can anybudy give me advice.
Typically masks go in front of the image you are trying to reshape.