Python Forum
Error message with PIL putpixel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error message with PIL putpixel
#1
Hey ! I want to change all the pixels of an image with this loop but I have an error message : "'module' object has not attribute 'putpixel' and I don't know why...

from PIL import Image

picture = Image.open("K:\profil\Bureau\CODES ISN\panda.jpg")
(largeur, longueur) = picture.size
print(largeur,"*",longueur)

for y in range(largeur) :
    for x in range(longueur) :
        newpicture = Image.putpixel(picture, (x,y), (116, 208, 241))

newpicture.show
Reply


Messages In This Thread
Error message with PIL putpixel - by louloudevinci - Mar-30-2018, 03:23 PM
RE: Error message with PIL putpixel - by wavic - Mar-30-2018, 03:31 PM
RE: Error message with PIL putpixel - by wavic - Mar-30-2018, 04:09 PM
RE: Error message with PIL putpixel - by wavic - Mar-30-2018, 05:02 PM
RE: Error message with PIL putpixel - by nilamo - May-08-2018, 07:46 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020