I'm trying to build and run a complicated imagemagick command from within 
Julia (drawing tons of ellipses in various colors, sizes, etc). To 
accomplish this I need to basically build a command out of many smaller 
parts that are parsed in a for-loop. It looks a bit like this right now: 

parseMagick(x,y,l,w) = `-fill $(l.h ? "magenta" : "yellow") -stroke none 
-draw "fill-opacity $(l.p) ellipse $x,$y $(w*l.p*l.e),$(w*l.p) 0,360" `

cmds = Array(Cmd,xn,yn)
for i = 1:xn, j = 1:yn
     cmds[i,j] = parseMagick(xs[i],ys[j],el[i,j],w)
end
run(`convert in.jpg $cmds out.jpg`)


This doesn't work because of how the cmds array is interpolated into the 
command. 
I suspect that I need to use some metaprogramming, which I still find hard 
to grasp. Anyone knows a good way of doing this?

Thanks!

Reply via email to