[Image-SIG] "Cloning" drawing interface objects

Fredrik Lundh fredrik at pythonware.com
Tue Sep 29 10:53:01 CEST 2009

On Tue, Sep 29, 2009 at 2:22 AM, John Wolter <jwolter0 at gmail.com> wrote:
> Forgive me if this is a real newbie question, but hey, as far as PIL goes,
> I'm a newbie.  I'm trying to write a script that draws on an image, then
> splits the image into two copies and draws more on them independently.  I
> can't seem to figure out how to do that second part.

> # Im3 = Im2.copy # This command causes a "AttributeError: 'function' object
> #    has no attribute 'mode'" error at the next draw on Im3

In Python, writing Im2.copy just gives you a reference to the method.
To actually call the method, you need to add parens:

    Im3 = Im2.copy()


More information about the Image-SIG mailing list