Почему ошибка TurtleGraphicsError с turtle color()
MAC-OS Я делаю апскейлер изображений на python. Когда я запускаю этот код:
from PIL import Image
import turtle
#upscale
much_ups = int(input("How much upscale? "))
#values
turtle.Pen()
im = Image.open('test.jpeg')
rgb_im = im.convert('RGB')
x = 0
y = 0
turtle.width(much_ups)
#main cykl
for yz in range(64):
for xz in range(64):
r, g, b = rgb_im.getpixel((x, y))
turtle.color((r,g,b))
turtle.forward(much_ups)
#print(r, g, b, x, y)
x += 1
if x == 64:
x = 0
y += 1
видает ошибку
Traceback (most recent call last):
File "/Users/yurii/Desktop/upscaler.py", line 20, in <module>
turtle.color((r,g,b))
File "<string>", line 8, in color
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 2216, in color
pcolor = self._colorstr(pcolor)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 2696, in _colorstr
return self.screen._colorstr(args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 1166, in _colorstr
raise TurtleGraphicsError("bad color sequence: %s" % str(color))
turtle.TurtleGraphicsError: bad color sequence: (149, 112, 129)
Что делать?
Источник: Stack Overflow на русском