|
Rotating an image is a fairly common operation. Photodesk has a basic image rotation feature, accessed from the image menu Image>Rotate... or by Ctrl-R. Here's the dialogue:
Here are some general points to note about rotation:
The dialogue offers various options:
I've carried out a simple trial to test how good each interpolation method is. Using the image at the top of the page, rotate it in 10° steps until it's upside down (for a total of 18 consecutive rotations), then Image>X flip and Image>Y flip to bring it the right way up again (the flips are lossless, so make no difference to the result). This is a fairly exacting test of any rotation algorithm.
All tests were carried out using Photodesk 3.06 on an Iyonix running RISC OS 5.11 with 512MB RAM.
I added the black rectangles and single-pixel white lines to see how well these would survive rotation.
The RISC OS feature of Adjust-clicks keeping dialogues open makes doing this operation very quick – set up the window as below and click Adjust on Rotate 18 times. I've used the Lose corners option as otherwise the image keeps on getting bigger and bigger (try it and see). The successive corner-chopping gives the circular effect seen below.
This is Bi-cubic interpolation (allegedly the best):
This is Bi-linear interpolation (medium quality):
And this is Nearest neighbour interpolation (low quality):
As usual, Bi-cubic is the highest quality but takes the longest. Nearest neighbour is the quickest but yields the poorest quality result. Bi-linear is a good compromise between speed and quality.It's clear that Nearest neighbour is by far the worst, as expected. It's difficult to think of any reason for using this method, other than as a fast preview of rotating a very large image (but see the timings below).
The Bi-cubic interpolation, allegedly the best, also suffers from pixelisation and staircasing artefacts.
The Bi-linear interpolation, while blurred, is – to my eyes at least – clearly the best. Here's a detail of each, zoomed in to double size:
Bi-linear also responds well to sharpening, unlike the Bi-cubic method. Here I've applied Image processing:Sharpen (coarse) at 75% Strength:
I've also included the timing for Paint, though because Paint doesn't have a 'lose corners' option it's not strictly comparable (it has to resize the image too). And just to show that RISC OS machines aren't quite as slow as some people make out, the last row is for Photoshop 5 on a Mac Mini with 512MB RAM running OS X 10.39 (more RAM would doubtless speed this up, as would a more recent Photoshop; and note that like Paint, Photoshop does not offer a 'lose corners' option so the image is also being resized).
Bi-cubic | 13 sec |
Bi-linear | 12 sec |
Nearest neighbour | 11 sec |
Paint | 15 sec |
Photoshop/Mac Mini | 51 sec |
There's not a huge difference in the Photodesk figures, perhaps suggesting that memory access is the critical bottleneck, rather than the algorithm.
According to theory (and practice in other graphics applications), Bi-cubic interpolation should be substantially better than it appears to be in Photodesk. It's possible that the implementation is flawed, or the dialogue could be triggering the wrong option (so selecting bilinear actually does bicubic, and vice versa).
Rob Davison's Variations also offers rotation, and has more options. There is no bicubic, but bilinear gives about the same result as the Bicubic option in Photodesk, supporting the theory that the latter program has got its options crossed.
I've reported these findings to the current maintainer, and await developments with interest.
Tutorial | One good turn... by Chris and Lee | ||
---|---|---|---|
Created | 12:06pm Wed 4 Oct 2006 | Last modified | 5:28pm Sun 22 Oct 2006 |
Category | Whole image operations | Level | Beginner |