Page 1 of 1

Rotated image gets unsharp/less quality

Posted: 2011-05-05T23:10:34-07:00
by pictogram
Hello,

when i rotate an image using the "-rotate 7" command, the resulting image looks unsharp and somewhat "flat" (less colors). Do i do something wrong? Re-sharpening it with "-sharpen 1" corrects this a bit.

Re: Rotated image gets unsharp/less quality

Posted: 2011-05-07T02:53:17-07:00
by whugemann
I think that this lies in the nature of rotation: The color values of the rotated image have to be interpolated from the neighbouring pixels in the original image, and any interpolation will blur the image by some extent. The effect will be most visible in images with sharp contrasting edges, like sketch drawings or cartoon-type images.

You could however try to choose an interpolation method more suitable for your actual image content via -interpolate.

Re: Rotated image gets unsharp/less quality

Posted: 2011-05-08T23:06:27-07:00
by pictogram
I see. The image i rotate is resized to about 30%. Does the order of scale/rotate matter? In my case i see no optical difference.

Re: Rotated image gets unsharp/less quality

Posted: 2011-05-08T23:36:50-07:00
by anthony
7 degrees is about the worst rotation angle you can get ;-)

rotate uses a fast technique (3 shears) that is fairly fuzzy. Distort produces rotations at higher quality, with much more control over that quality but at a speed cost. make sure you IM is at least version 6.6.5-0 or better still the latest you can get!

See Im examples, Simple Image Warping, Rotating a Thin Line
http://www.imagemagick.org/Usage/warping/#rotate_line

Interpolated Rotations (thin line)
http://www.imagemagick.org/Usage/misc/#interpolate_line

Distort SRT (Scale Rotate Translate)
http://www.imagemagick.org/Usage/distorts/#srt

Distort General Theory, concepts and problems with image distortions (including rotations and scaling)
http://www.imagemagick.org/Usage/distorts/#summary

Distort Super Sampling (which works VERY well for rotations)
http://www.imagemagick.org/Usage/distorts/#super_sample