podría utilizar el módulo de Tkinter, que es la interfaz estándar de Python para el conjunto de herramientas Tk GUI y se no necesita descarga adicional. Ver https://docs.python.org/2/library/tkinter.html.
(Para Python 3, Tkinter se cambia el nombre a tkinter)
Aquí es cómo establecer los valores RGB:
#from http://tkinter.unpythonic.net/wiki/PhotoImage
from Tkinter import *
root = Tk()
def pixel(image, pos, color):
"""Place pixel at pos=(x,y) on image, with color=(r,g,b)."""
r,g,b = color
x,y = pos
image.put("#%02x%02x%02x" % (r,g,b), (y, x))
photo = PhotoImage(width=32, height=32)
pixel(photo, (16,16), (255,0,0)) # One lone pixel in the middle...
label = Label(root, image=photo)
label.grid()
root.mainloop()
y obtener RGB:
#from http://www.kosbie.net/cmu/spring-14/15-112/handouts/steganographyEncoder.py
def getRGB(image, x, y):
value = image.get(x, y)
return tuple(map(int, value.split(" ")))
Afortunadamente, instalar PIL es muy sencillo en Linux y Windows (no sé sobre Mac) – heltonbiker
Instalar PIL en Mac me llevó demasiado tiempo . –
@ArturSapek, instalé PIL por 'pip', que era bastante fácil. – michaelliu