putdata if you are interested drawing mathematical objects like fractalsplotting points pixelby-pixel can be very slow in python one way to speed things up is to use the putdata method the way it works is you supply it with list of rgb pixel valuesand it will copy it into your image here is program that plots grid of random colors from random import randint from tkinter import from pil import imageimagetk root tk(canvas canvas(width= height= canvas grid(image=image new(mode'rgb ',size=( , ) [(randint( , )randint( , )randint( , )for in range( for in range( )image putdata(lphoto=imagetk photoimage(imagecanvas create_image( , ,image=photo,anchor=nwmainloop(figure (leftputdata example (rightimagedraw example imagedraw the imagedraw module gives another way to draw onto images it can be used to draw rectanglescirclespointsand morejust like tkinter canvasesbut it is faster here is short example that fills the image with dark blue color and then randomly distributed yellow points from random import randint from tkinter import