This week Hugo Tait sent me an excellent question about how to expand a tracing object.
Unfortunately, there wasn't much of an example in the javascript guide.
It took a little experimentation, but I came up with the following script, and thought I'd share it with all of you here. This will take the current selected Raster object (embedded not placed) and convert it into 4 color geometry.
var doc = activeDocument;
var obj = doc.selection[0];
var r = obj.trace();
var options = r.tracing.tracingOptions;
options.tracingMode = TracingModeType.TRACINGMODECOLOR;
options.ignoreWhite=true;
options.maxColors=4;
redraw();
r.tracing.expandTracing();
cheers,
-J
Subscribe to:
Post Comments (Atom)
2 comments:
Oh, gee, I found this excellent JS4AI blog when I was searching for JavaScript for Artificial Intelligence. Oh well, it's still a beautiful blog. Best of luck! -Arthur T. Murray (Mentifex)
Sometimes I think Illustrator has a mind of it's own. :)
It would be interesting to see some artificial intelligence experiments adapted to illustrator. Let me know if you have any ideas.
Post a Comment