from PIL import Image
im = Image.open("white.jpg")
pix = im.load()
width = im.size[0] #获取图像宽度值
height = im.size[1] #获取图像高度值
for x in range(width):
for y in range(height):
if x<=width//2 and y<=height//2:
if x%50==0 or y%50==0 :
pix[x,y]=(0,0,0)
elif y>height//2:
if x==y or width-x==y :
pix[x,y]=(0,0,0)
im.show ()
white.jpg
程序执行后的图像效果是( )