get pixel color? set pixel color? from an image...
Jan 12, 2009 1:32:27 GMT -5
Post by davos1 on Jan 12, 2009 1:32:27 GMT -5
Hi,
I am wondering if it is possible to allow to RB to get the color of a pixel in an image (#imageload) -and to update it-.
as an example -I had to use python image from PIL to solve it-
'load the image..
'then get the pixel values independently (c(1)=R,c(2)=G,c(3)=B)
c=pix(x,y)
'print the values
print "RGB";pix(x,y);
print "only R";c(0);"only G""; c(1);"only B";c(2)
'set a new value
pix(x,y)=(125,249,255)
getting the color of a pixel of a loaded image would add RB image manipulation capacity.
also, if that could be integrated with the #graphic (pixel to pixel transfer), or you could mix photos with graphics and save the mix or get info from the image loaded.
well , just dreamming, :)
I am wondering if it is possible to allow to RB to get the color of a pixel in an image (#imageload) -and to update it-.
as an example -I had to use python image from PIL to solve it-
'load the image..
'then get the pixel values independently (c(1)=R,c(2)=G,c(3)=B)
c=pix(x,y)
'print the values
print "RGB";pix(x,y);
print "only R";c(0);"only G""; c(1);"only B";c(2)
'set a new value
pix(x,y)=(125,249,255)
getting the color of a pixel of a loaded image would add RB image manipulation capacity.
also, if that could be integrated with the #graphic (pixel to pixel transfer), or you could mix photos with graphics and save the mix or get info from the image loaded.
well , just dreamming, :)