[Image-SIG] WG: How to create instance of Image ?

Fredrik Lundh fredrik@pythonware.com
Wed, 16 Jun 1999 13:05:57 +0200

Graf Patrick <pg@puggy.com> wrote:
> maybe a simple problem, if you know the solution....
> I'm trying to write a class for my own image processing needs.
> In this matter, I'm having problems with some variable declarations
> I'd like to create a image variable, let's call it myPicture .
> So I tried to declare
> myPicture = Image.Image()

what made you think you could write that? ;-)

the only way to create new images in PIL is to use
a factory function; the two most commonly used
functions are Image.open and Image.new.

see the docs for more info:

> Note: Is it possible to use an Image object and pass it to a procedure ?

pass it do a Python function?  sure.  like,

    def procedure(im):