422,023 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,023 IT Pros & Developers. It's quick & easy.

float() takes at most 1 argument (2 given)

P: 2
def make_square(im, min_size=0, fill_color=(206, 150, 106, 0)):
x, y = im.size
size = max(min_size, x, y)
new_im = Image.new('RGB', (size, size), fill_color)
new_im.paste(im, (float((size - x) / 2, (size - y) / 2)))
return new_im

then i got error :
TypeError Traceback (most recent call last)
<ipython-input-15-d7020999e20a> in <module>()
11 size = (30, 30)
12
---> 13 img = make_square(img)
14 img = img.resize(size, Image.ANTIALIAS)
15 matrix = np.array(img)

<ipython-input-14-8407033de8d8> in make_square(im, min_size, fill_color)
3 size = max(min_size, x, y)
4 new_im = Image.new('RGB', (size, size), fill_color)
----> 5 new_im.paste(im, (float((size - x) / 2, (size - y) / 2)))
6 return new_im

TypeError: float() takes at most 1 argument (2 given)

please help mee...
1 Week Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.