iOS - Image crop with gesture in circle - ios

I am developing an iOS app in which I need to crop image with finger. Like any one take picture and then can crop any part of image with finger. I have searched the Internet but I am getting tools what can crop images into rectangular area. Can anyone please help me to crop image with pan gesture with rough pattern?
Any help will be much appreciated.

There is not straight API from apple to help you do that. You will have to create your own custom mask layer and get the image.graphic context and apply the user created mask to that context your self.
You might want to dig deeper into this thread: ImagePicker Library with custom crop rect?

I found this one solution which mentioned all requirement.

Related

Tiled Background Image Moving Diagonally In View

I've seen many solutions out here but they're not exactly what I'm looking for. What I'm attempting to do is have the view's background to move an image multiple times-- slowly and diagonally rather than horizontally or vertically.
From a web designing perspective, this can be achieved with a tiled bg.gif where the image gives the effect of an image moving without additional programming.
Example:
However, I'm not sure whether this is achievable within Swift programming. I'm sure alternative solutions are out there like having a single image (a smiley face) tiled to fill the view frame and have it move diagonally by incrementing it's x & y coordinates.
I'm new to iOS development and Swift yet I am learning a lot! Much help will be appreciated.
refer this two links. it will help to achieve what you want. click here and click here
Update as advised in comment : download SwiftGif and Import the Gif.swift in your project and do the following:
// Returns an animated UIImage
let myGif = UIImage.gifWithName("imggif")
// Use the UIImage in your UIImageView
let imageView = UIImageView(image: myGif)
here imggif is your gif image which shown in question. put it in your project
hope this will help :)

Detect touch on irregular shaped images that are closely placed inside a UIView

I have situation where large number of images are placed closed to one another inside a view, each image has its own image-view. The images are high resolution pngs and are irregular shape such as shape of a country. The problem is that I wish to do something uniquely when an image is touched. However, the frames of image-views are all rectangles and overlap neighboring images and hence correct detection is not possible.
I would really appreciate any guidance in this regard. Please let me know if I have not clearly explained my problem.
Regards
Check this question (Detect touches only on non-transparent pixels of UIImageView, efficiently)
On github, you can find a project by Ole Begemann which extends UIButton so that it only detects touches where the button's image is not transparent.
Since UIButton is a subclass of UIView, adapting it to UIImageView should be straightforward.
Hope this helps.

how can I make a custom overlay filter?

I have a viewController with a UIImageView. The imageView is to be loaded with a different random picture from a given array when the viewController is displayed. Above the UIImageView I would like to implement a filter similar to one I found in photoshop but with my own custom modification for a clear window to the image below. Basically, what I am looking to do is display a random image behind a blurred filter but I would like a part of the blur filter to have a custom shaped window to the image below it where the image can be seen clearly. The rest of the image would still be blurred out. I have read apples documentation for applying filters to images but none of them suit my needs. Pretty new to development and haven't written any code for this feature yet. I'm more looking to see if it can be done and if so, could you point me in the direction of where I can research to find the answers I'm looking for? cheers!
I would recommend that you take the input image, pass it through a CIGaussianBlur, then I'd draw the image applying an image mask (using CIBlendWithMask or a CGPath.)

Locate rectangular in image with OpenCV

I'm having trouble with positioning a rectangle in an image. Please see attached photos!
I need to determine the position of the rectangle (black) in the image.
Help me write code with OpenCV. I'm trying to rotate the image based on the black rectangle.
Thank you!
P/s: Because of its ability to present my poor english, hope you understood ignored. Thank you!!
This sample image: http://i.upanh.com/rrkcnu
Now I have found a method. The information you see here: http://felix.abecassis.me/2011/10/opencv-bounding-box-skew-angle/
It can rotate images automatically!!!

Circular White Pinch Gesture Overlay commonly used for Blurring Images in iOS

I have implemented the ability to blur images in my iOS app using the pinch gesture, however I would like to implement a circular white overlay that is commonly used as a reference point with the pinch gesture so that the user can adjust the amount of blur. Just like the image below:
The image above was from: https://media.tumblr.com/tumblr_lutwauVUW31qm4rc3.png
How can I implement this feature?
Thanks!
GaussianSelectiveBlurFilter in GPUImage lib may be help yo a lot. well,here is the github source.
I think it is not hard to use, hope you will enjoy it.
You can use a GPUImageVignetteFilter, and set the vignette color to white.
I'm guessing you're implementing the blur with GPUImageGaussianSelectiveBlurFilter within GPUImage (because I see you tagged GPUImage in your question). If you are, you'll notice that the properties on GPUImageGaussianSelectiveBlurFilter don't exactly translate over to GPUImageVignetteFilter, so you'll have to do a bit of math to translate to a new "coordinate" system, but it's fairly trivial.

Resources