Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On rotate and rotozoom, can't find fixes on these on the internet, anywhere. Basically, the video is showing 4 things in this order: 1. A ring image being rotated with .rotate. 2. A simple image being rotated with .rotate. 3. The ring rotated with .rotozoom. 4. The simple circle rotated with .rotozoom.

The difference: In 1 and 2, the images do not have that slight quiver/movement, but are reduced in quality. It might be difficult to tell with the video quality, but the ring image is slightly pixelated/blurred. In 3 and 4, the images are of equal/better than 1&2 quality when rotated with rotozoom, but they have this VERY SLIGHT but noticeable wobble about them. This is VERY noticable with test 3, where I put my mouse next to the circle outline, and you can see it move.

ANY and all help will be greatly appreciated, AND this will help many people for a long time, i'm sure.

Here are images of the differences in picture quality of rotate vs rotozoom:

share|improve this question
I don't know anything about pygame, but this looks like an alpha blending aliasing issue. You can read about the topic here, for example:… – maul Jan 27 '13 at 10:18
up vote 1 down vote accepted

Rotations of anything other than 90 degree increments requires resampling which cannot be done both quickly and accurately in software, and always loses detail anyway. The same applies for scaling/zooming for anything other than integer increments.

The slight 'wobble' you sometimes see is presumably related to the fact that the image size and height must change during rotation and therefore the centre of the image falls between 2 pixels half of the time, and must be rounded to one or the other to be rendered.

Ideally, if you want real-time rotation and scaling with sub-pixel precision, you need to be using a system backed by OpenGL or DirectX. In Python, that usually means pyglet, but you can roll your own using pyopengl. This cannot completely prevent some degree of blurring or pixellation, because information is necessarily thrown away when you resample an image, but it will usually be better than if done in software and certainly faster.

share|improve this answer
Thanks for the help! – Eliot Leo Carney-Seim Feb 7 '13 at 3:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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