[Image-SIG] New to PIL routines

Larry Bates lbates@swamisoft.com
Wed, 13 Jun 2001 17:27:02 -0500


I haven't been using the PIL routines for very long, but I have been
successful in getting most functions to work.  I tried to use new functions
today to combine two .JPG files (background and foreground information)

I used ActiveState's built-in Python Package Manager and downloaded and
installed Python Imaging Library and the PILGraph package.  Some features of
the Python Imaging Library seem to work properly (open, resize, rotate,
thumbnails, etc.).  I've used them extensively in other programs.  Today I
needed to use new features (blend, composite, merge) and they are not
working properly.  The errors don't appear to be path or other easily
diagnosed problems.

Sample programs/output

import Image
#
# Blend two images together to form a composite image
#
file1="c:\\temp\\DollarBill.jpg"
file2="c:\\temp\\revenue001.jpg"
im=Image.blend(file1,file2,0.5)
im.save("c:\\temp\\blend.jpg")

gives following error

Traceback (most recent call last):
  File "c:\python21\pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
    exec codeObject in __main__.__dict__
  File "F:\Swami\Projects\EBSCO\2000-2001\python\ALSDE_blend.py", line 12,
in ?
    im=Image.blend(file1,file2,0.5)
  File "C:\PYTHON21\PIL\Image.py", line 914, in blend
    im1.load()
AttributeError: load

and

import Image
#
# Blend two images together to form a composite image
#
file1="c:\\temp\\DollarBill.jpg"
file2="c:\\temp\\revenue001.jpg"
im=Image.composite(file1,file2,"L")
im.save("c:\\temp\\blend.jpg")

gives the following error:

Traceback (most recent call last):
  File "c:\python21\pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
    exec codeObject in __main__.__dict__
  File "F:\Swami\Projects\EBSCO\2000-2001\python\ALSDE_blend.py", line 13,
in ?
    im=Image.composite(file1,file2,"L")
  File "C:\PYTHON21\PIL\Image.py", line 921, in composite
    image = image2.copy()
AttributeError: copy


Thanks in advance for any assistance.