# Image Rotation, Line Symmetry

I'd like to import an image, superimpose it, reduce the opacity of the overlaid image, and then use a manipulate to rotate the top image to illustrate rotational symmetry.

The image below is using image editing software, not Mathematica, but illustrates the effect I am after. There are many nice images on the net that could be used to illustrate this concept. Can this be done using Mathematica and the image processing commands?

I tried importing an image file, then used Show and ImageRotate

for example,

g1 = Import[ graphic....]
Show [ g1,  ImageRotate[g1, pi/4]]


but that wasn't at all what I was looking for...

I'd appreciate any suggestions for commands that could achieve this effect.

My goal would be to create several Manipulates with various images to illustrate various orders of symmetry with image files (I've already done this with line drawings).

Some related hopefully useful images:     Here is another approach using a background to prevent cropping of the rotated image when its aspect ratio is far from 1:

im = Import["http://i.stack.imgur.com/pyNu2.png"] im2 = SetAlphaChannel[im, ColorNegate[im]];
bg = ImageCompose[
Rasterize[
Graphics[{Lighter[Orange], Rectangle[{0, 0}, {1, 1}]},
PlotRange -> {{0, 1}, {0, 1}}], "Image", ImageSize -> 600], im2];

Manipulate[
Show[ImageCompose[bg, ImageRotate[im2, angle, {600, 600}]]], {angle,
0, 2 Pi}] Edit

If you want smooth blending instead of a sharp alpha channel as I did in the first approach, you could do this:

crop = Rasterize[
Graphics[{White, Disk[]}, PlotRange -> {{-1, 1}, {-1, 1}}],
"Image", ImageSize -> 600, Background -> Black];

Manipulate[
SetAlphaChannel[
ImageCompose[bg, {ImageRotate[bg, angle, {600, 600}], .5}],
crop], {angle, 0, 2 Pi}] Here, I added another cropping mask in the form of a disk to prevent the partially uncovered corners from showing.

• Thank you, that's fantastic and just what I needed. I also appreciate the extra help with dealing with images that are not square. I've already put this approach to use on a lesson I'm giving to a student tomorrow. Thanks so much! – Tom De Vries Mar 18 '13 at 19:59

Something like this maybe:

image = ImageResize[ExampleData[{"TestImage", "Lena"}], 200];

Manipulate[ImageCompose[image, {ImageRotate[image, a], 0.5}], {a, 0, 2 Pi}] • Thank you! ImageCompose is what I needed. Great answer, I appreciate your input. – Tom De Vries Mar 18 '13 at 20:05