“Python Zdobądź kolor pikseli” Kod odpowiedzi

Python Zdobądź kolor pikseli

from PIL import Image

im = Image.open('dead_parrot.jpg') # Can be many different formats.
pix = im.load()
print im.size  # Get the width and hight of the image for iterating over
print pix[x,y]  # Get the RGBA Value of the a pixel of an image
pix[x,y] = value  # Set the RGBA Value of the image (tuple)
im.save('alive_parrot.png')  # Save the modified pixels as .png
Good Gentoo

Jak uzyskać wartość RGB z Pixel na ekranie Python na żywo

import PIL.ImageGrab
rgb = PIL.ImageGrab.grab().load()[x,y]
Frightened Falcon

Python Zdobądź kolor pikseli z ekranu

import ImageGrab

px = ImageGrab.grab().load()
for y in range(0, 100, 10):
    for x in range(0, 100, 10):
        color = px[x, y]
Good Gentoo

Odpowiedzi podobne do “Python Zdobądź kolor pikseli”

Pytania podobne do “Python Zdobądź kolor pikseli”

Więcej pokrewnych odpowiedzi na “Python Zdobądź kolor pikseli” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu