9951 explained code solutions for 126 technologies


python-pillowHow to draw a point


from PIL import Image, ImageDraw
  
im = Image.new("RGB", (400, 300))  
dr = ImageDraw.Draw(im)
dr.point((50,50), fill="white")
im.show()ctrl + c
PIL

import Pillow package modules

Image.new

create new PIL image object

ImageDraw.Draw

create drawing object

.point(

draws a single point

(50,50)

point coordinates

.show()

displays resulting image