Hello,

 

I'm trying to sharpen some JPEGs after resizing and am being given a
valueError as per the below:

 

  File "getGraphicDetails.py", line 32, in main

    enhancer = ImageEnhance.Sharpness(img)

  File "/usr/local/lib/python2.3/site-packages/PIL/ImageEnhance.py",
line 89, in __init__

    self.degenerate = image.filter(ImageFilter.SMOOTH)

  File "/usr/local/lib/python2.3/site-packages/PIL/Image.py", line 786,
in filter

    return self._new(filter.filter(self.im))

  File "/usr/local/lib/python2.3/site-packages/PIL/ImageFilter.py", line
55, in filter

    return apply(image.filter, self.filterargs)

ValueError: image has wrong mode

 

Does anyone know if I'm just using an old version of PIL and this has
subsequently been addressed or if I'm using it incorrectly.  It appears
to die on the line:

 

enhancer = ImageEnhance.Sharpness(img)

 

If I put in an:

 

If img.mode = "1":

   enhancer = ImageEnhance.Sharpness(img.convert("L"))

 

it works fine, but I was wondering if the library should or does work
without having to convert.

 

Thankyou

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to