1
$\begingroup$

How can I painlessly rotate a tiff image by some small angle around a point with specific coordinates? The image shouldn't be altered otherwise, it can be padded with zeros if necessary, and then saved back into tiff format. It should also output the coordinates of the center of rotation on a new image.

I see ImageRotate function but it doesn't allow to specify the point of rotation.

Thank you.

$\endgroup$
  • 1
    $\begingroup$ Please show an example input and two example outputs for two different centers of rotation. I can't see how a "center of rotation" makes any difference when you need to pad the image anyway. $\endgroup$ – Szabolcs Mar 1 '18 at 17:38
  • $\begingroup$ Easiest way is probably to combine ImageTransformation and RotationTransform (where you can specify a center). $\endgroup$ – Niki Estner Mar 1 '18 at 17:39
6
$\begingroup$

you might want to work with ImageTransformation

ImageTransformation[ img ,
 RotationTransform[ .2 , {.75, .5} ] , 
 PlotRange -> {{-1/2, 3/2}, {-1/2, 3/2}}, Background -> White, 
 Masking -> All]

enter image description here

animation of rotation about a point near the edge..

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.