4
$\begingroup$

I would like to rotate a raster image by an arbitrary angle. I don't really care for speed: the rotation should be of highest quality possible. Could someone please suggest a suitable algorithm?

I'm familiar with the rotation by three shears but I'm not sure if the shears would not cause too much aliasing/blurring.

$\endgroup$
  • $\begingroup$ The 'rotation by area mapping' algorithm described at leptonica.com/rotation.html looks like a good place to start $\endgroup$ – russ May 30 '16 at 7:39
4
$\begingroup$

It speed does not matter, I suggest to use a truncated sinc or a Lanczos isotropic kernel: to compute a target pixel, you back-rotate the filter and convolve it with the image. Since it is isotropic, it is separable and you can even use a square filter parallel to the axis of the source image.

$\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.