fogleman / Quads

Computer art based on quadtrees.

Home Page:http://www.michaelfogleman.com/static/quads/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: integer argument expected, got float

debonx opened this issue · comments

First of all thanks for this! I'm doing some visual experiments with this but I get the following when python main.py example.png:

1 49.6791813927697 2 44.536910327764055 3 39.91618908262801 4 39.04791319794365 5 35.82065887614508 6 32.903885446601905 7 32.326656149530756 8 31.714629322062837 10 31.140527906852704 14 30.613942522457467 18 29.42850703649822 20 28.452708100795892 26 27.83647822542313 33 26.858610254863855 43 25.775960929898222 55 25.270909080544094 67 24.678935588991983 83 24.16320784114418 84 23.433750446224078 111 22.89905634295383 161 22.390065776883368 211 21.88953562147702 283 21.379515331465882 322 20.87853839260973 429 20.37431830735203 487 19.664391058523808 589 19.159472748595544 723 18.657686967639428 834 17.949467911576072 Traceback (most recent call last): File "main.py", line 157, in <module> main() File "main.py", line 143, in main model.render('output.png') File "main.py", line 124, in render draw.rectangle(box, quad.color) File "usr/miniconda3/lib/python3.6/site-packages/PIL/ImageDraw.py", line 245, in rectangle ink, fill = self._getink(outline, fill) File "usr/miniconda3/lib/python3.6/site-packages/PIL/ImageDraw.py", line 119, in _getink fill = self.draw.draw_ink(fill, self.mode) TypeError: integer argument expected, got float

Do you know how to fix it? I'm on python 3.6.7. Many thanks.

I solved changing this:

from return (r, g, b), e
to return (int(r), int(g), int(b)), e