[Python] Using putpixel() doesn't write pixel values to image

Discussão em 'Python' iniciado por Stack, Abril 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am using putpixel on an image (srcImage) which is w = 134 and h = 454.

    The code here gets the r,g,b value of a part of the font which is 0,255,0 (which I found through debugging, using print option).

    image = letters['H']
    r,g,b = image.getpixel((1,1)) #Note r g b values are 0, 255,0
    srcImage.putpixel((10,15),(r,g,b))
    srcImage.save('lolmini2.jpg')


    This code does not throw any error. However, when I check the saved image I cannot spot the pure green pixel.

    Continue reading...

Compartilhe esta Página