def image_to_rgb(self, path, n=<NUM_LIT:10>):
from PIL import Image<EOL>img = Image.open(path)<EOL>p = img.getdata()<EOL>f = lambda p: choice(p)<EOL>for i in _range(n):<EOL><INDENT>rgba = f(p)<EOL>rgba = _list(rgba)<EOL>if len(rgba) == <NUM_LIT:3>:<EOL><INDENT>rgba.append(<NUM_LIT:255>)<EOL><DEDENT>r, g, b, a = [v / <NUM_LIT> for v in rgba]<EOL>clr = color(r, g, b, a, mode="<STR_LIT>")<EOL>self.append(clr)<EOL><DEDENT>
Returns a list of colors based on pixel values in the image.

The Core Image library must be present to determine pixel colors.
F. Albers: http://nodebox.net/code/index.php/shared_2007-06-11-11-37-05