May-31-2018, 03:13 PM
(r, g, b) = picture_1.getpixel((x,y)You don't need color of pixel from your original picture because you dont actually use them
So altogether, with loop changed to this:
for x in range(largeur) : for y in range(longueur) : r = randint(0,25) g = randint(0,255) b = randint(0,255) picture_2.putpixel((x,y), (r, g, b))it will create a new image with the same size as your original picture and every pixel will have random color.
Or is this not actually what you wanted? :D