Essentially I need to create an image 9 pixels wide x 7 high, black background, white smiley face on it. The white pixels are at (3,2), (3,5), (3,1), (5,1), (5,2), (5,5), (2,4), (6,4), (4,5) in a (w,h) format.
I assumed the background would default to black, but that hasn't happened, so I've added a line to make black the default. That also hasn't worked.
Whatever I have tried has just converted the entire image to one colour.
import PIL.Image as pim
width=8
height=6
my_image = pim.new("1", (width, height))
for i in range(width):
for j in range(height):
my_image.putpixel((i,j),(0))
if i== 3 or 5 and j == 1 or 2 or 5:
my_image.putpixel((i,j),(1))
if i==2 or 6 and j ==4:
my_image.putpixel((i,j),(1))
if i==4 and j ==5:
my_image.putpixel((i,j),(1))