at job we have modify a PHP that allow to our user to upload->crop an image
with floating area user can select a small portion of image and then commit cut.
Final result is a txt file with some info that are parsed from a script that do things.
one of thing to do is cut select area, post an image to explain our goal:

Our PHP return 4 usefull info, coord for point A and point B. From these we can obtain also C and D coordinates.
Now, how i can script a cut that return my roses in right way ?
thank you for any info,
m.