i need you to write a code in Swift that can make image perspective. please download the attachments.
i want the foregroundImage to be placed EXACTLY in the green section (backgroundImage).. as you can see, the green section is perspective. and background image is always in square.
the flow is :
1. resize the backgroundImage to be 2000x2000 px.
2. resize the foregroundImage to be 2000x2000 px with Aspect Fill so the foregroundImage didn't get distorted.
3. transform the resized foregroundImage.
4. combined resized foregroundImage and transformed backgroundImage.
5. view the result image in screen.
6. user can save the result image in 2000 x 2000 px.
step 1 - 4 is in the background process... so user will not see it.
you can use the code in the attachment to create the perspective and you can measure the corner using Photoshop. or if you measure it in another way, let me know how you measure the corner.
i need the complete xcode project file.. so i can put it in my app.
i've add my xcode file in attachment. the foregroundImage is the user selected image from photo library.
user select image from their photo library [done]
crop it [done]
resize - transform - combine with background image [this is what i need]
save it [i need this too]
if you having trouble to understand what i mean, please download preview.jpg in the attachment.
as you can see, if i use iPhone 6 simulator, the red rectangle (foreground image) is missed.. i want it to exactly in the green section in all device.
if you know what i mean and place bid for less than $100, i'll choose you.