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.

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

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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