[Image-SIG] bounce animation of an image

Fredrik Lundh fredrik at pythonware.com
Mon Aug 3 18:11:00 CEST 2009


On Mon, Aug 3, 2009 at 3:32 AM, Astan Chee<astan.chee at al.com.au> wrote:

> I have a script that takes an image and makes it looks like it "bounces".
> Here it is:

>  But it keeps failing with a "ValueError: images do not match" when I do the
> pasting. What am I doing wrong?

You're passing in floating point coordinates to crop and paste, and it
appears that crop and paste doesn't necessarily agree on how big the
region is when you do that.  This is probably a buglet, but you should
use integer coordinates anyway; just change both calls to saveImg to:

      saveImg(p,int(pos+0.5))

(or do the rounding inside the function), and paste should work.

</F>


More information about the Image-SIG mailing list