Take part of image under locator

How to create Manipulator with Locator to take part of an image?

-
Have a look at this question –  cormullion Dec 11 '12 at 12:38
Good, thanks! But how to avoid padding of croped image? –  Elfet Dec 11 '12 at 12:50
Perhaps you could expand your question to include this information... This will also help to avoid this question being closed as a duplicate... –  cormullion Dec 11 '12 at 13:28

One way that Manipulate[] can control the portion of the selected image with a locator is:

img = ExampleData[{"TestImage", "Mandrill"}];
{dR, dC} = ImageDimensions[img];
Manipulate[
Show[img,
ImageTake[img, {dR-50-p[[2]], dR+50-p[[2]]}, {p[[1]]-50,p[[1]] + 50}]],
{{p, {dR/2, dC/2}}, Locator}]


This lets you scan around, zooming into the image. Control the size by the integers inside ImageTake[] (set to 50 here).

-
Of course, this is completely automatic in version 9. If we Import your image and just click on it, we get easy access to a crop tool, as well as others. It looks something like so: