python - How to save an Image locally using PIL -


i making program builds thumbnail based on user input, , running problems saving image. used c++ can save image, seems python not support this.

this code right now:

def combine(self):     img = image.new("rgba", (top.width,top.height+mid.height+mid.height),(255,255,255))     img.paste(top, (0,0))     img.paste(mid, (0,top.height))     img.paste(bot, (0,top.height+mid.height))     img.show()     img.save("thumbnail.png", "png") 

the error shows when run :

traceback (most recent call last):    file "texttothumbnail.py", line 4, in <module>     class thumbnail(object):   file "texttothumbnail.py", line 461, in thumbnail     img.save("thumbnail.png", "png") nameerror: name 'img' not defined 

what going on? preferably want able save image locally, since program running on multiple setups different pathways program.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -