I'm trying to create a Mathematica Manipulate
that generates a graphical call-out using a 'loupe'-style or magnifying glass enlarger - a possible solution is shown in this mock-up:
The idea is that you can move the focus (a point on the source image, I suppose), and see the enlarged result inside the 'loupe' or magnifying glass. Variable enlargement would be needed as well. It could be a rectangular loupe, I suppose, but circles would be cool.
This style of image is generally recommended because it allows people to see details and the context of those details.
This is what I've managed to do so far:
m = ImageResize[ExampleData[{"TestImage", "Mandrill"}], 300];
imageData = ImageData[m, DataReversed -> True];
Manipulate[
Grid[
{{
Graphics[{
Raster[imageData, {{0, 0}, ImageDimensions[m]}], Point[pt]},
ImageSize -> ImageDimensions[m]],
Graphics[{Raster[imageData, {{0, 0}, ImageDimensions[m]}],
Disk[pt, 5]}, ImageSize -> ImageDimensions[m]]
}}],
{{pt, {200, 200}}, Locator}]
The dot in the right image follows the left image.
I can't see how to make the circular shape or to make it track the point or to add a magnifying option.
Help or clues appreciated!
Edit
I thought all these answers were great and it's a pity I can't accept them all... :( I noticed that with some of the solutions (@szabolcs, @simon) the image seems to be transformed and looks better/smoother than it really is, whereas the other solutions show the pixels themselves. Both approaches are useful in their own way, depending on whether you're trying to point out the pixel structure or the image content.