I have used PIL
#back_color_width
for x in range(w):
for y in range(h):
if x==0 or y==0 or x==w-1 or y==h-1 :
pixels[x,y] = back_color
I need to add a border to the image with a width on all 4 sides of image
解决方案
This is what you need to change to make the border any number of px wide:
for x in range(w):
for y in range(h):
if (x
or y
or x>w-border_width-1
or y>h-border_width-1):
pixels[x,y] = (0,0,0)
#other 3 boxes and #primary box Doesn't make boxes but instead 3 points and 1 point respectively.