<p>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.</p>

CC BY-SA 3.0
2016-06-04T11:55:24.110Z
2016-06-04T11:55:24.110Z
Fabrice NEYRET
<p>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?</p>

<p>I'm familiar with the <a href="http://www.leptonica.com/rotation.html#ROTATION-BY-SHEAR" rel="noreferrer">rotation by three shears</a> but I'm not sure if the shears would not cause too much aliasing/blurring.</p>

CC BY-SA 3.0
2016-05-30T07:39:46.800Z
The 'rotation by area mapping' algorithm described at http://www.leptonica.com/rotation.html looks like a good place to start
russ
<algorithm><transformations><image-processing><2d><raster-image>
Image rotation algorithm
Ecir Hana
# Image rotation algorithm

(Asked by: username_0 on 2016-05-28)

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](http://www.leptonica.com/rotation.html#ROTATION-BY-SHEAR) but I'm not sure if the shears would not cause too much aliasing/blurring.

**Tags:** algorithm, transformations, image-processing, 2d, raster-image

> **Comments:**
> **username_1**: The 'rotation by area mapping' algorithm described at http://www.leptonica.com/rotation.html looks like a good place to start  

---

## 1 answers

### Answer by username_2 on 2016-06-04. Score: 4

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.


---

