adding text in to a picture using python

Joined
Aug 23, 2010
Messages
1
Reaction score
0
I am try to run this following function which supposedly add phrase or text in to the image. The image and phrase are passed as arguments in to the function.

Note that i cannot use an other image functions other than getpixel, putpixel, load and save as per the assignment (i am very new to python, open to suggestions or help).

def InsertTxtImage(srcImage, phrase):
pix = srcImage.load()
for index,value in enumerate(phrase):
pix[10+index,15] = phrase[index]
srcImage.save()
pass

This code is giving "system error" which says that "new style getargs format but argument is not tuple"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top