[Tutor] [tutor] Problem in saving image file which is modified by ImageEnhance

Varsha Purohit varsha.purohit at gmail.com
Sun Feb 10 07:12:35 CET 2008


Hello All,
         I am using PIL function to change brightness of an image. But i am
getting an error when i am trying to save that image. Here is the code..

import Image
import ImageChops, ImageEnhance
import math, operator

file1 = Image.open("r10001t0.jpg")
file2 = Image.open("r10001t1.jpg")

diff = ImageChops.difference(file1,file2)

enhancer = ImageEnhance.Brightness(diff)


ext = ".jpg"
enhancer.save("diff1" + ext, "JPEG", quality =100)



I am getting error as ImageEnhance doesn't have attribute called save... how
should i save the enhanced image... or alternatively when i am comparing two
images using imagechops i am getting a black back ground... how should i
make it little brighter or use another colour instead of black ???

-- 
Varsha Purohit,
Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080209/fc5808df/attachment.htm 


More information about the Tutor mailing list