ximport("coreimage") from math import cos, sin, pi ''' To do: + pixels instead of ovals? + 3-d rep (layering) + bigger, compass marks, etc + animation of a directory ''' WIDTH = 512 HEIGHT = 512 translate(WIDTH/2, HEIGHT/2) def ptor(r, ang): w = pi * (ang*360) / 180.0 return (r * cos(w), r * sin(w)) canvas = coreimage.canvas(WIDTH, HEIGHT) l = canvas.append(u"/Users/char/Pictures/IMG_8211.CR2") pxs = l.pixels() path = [] # bug: off by one # todo: optimize skips for n in range(len(pxs)): npts = 50000 # draw this many samples (taken periodically) if n % (len(pxs)/npts) == 0: path.append(pxs[n]) for p in path: xy = ptor(p.saturation, p.hue) fill(p) oval(xy[0]*100, xy[1]*100, 2, 2)