first you need to Trace your image, that would return a PluginItem where you can point to a TracingObject that you can adjust properties to,
var tracedImage = thisImage.trace();
tracedImage.tracing.tracingOptions.tracingMethod = TracingMethodType.TRACINGMETHODABUTTING;
thisImage is traced image already.
var thisImage = selectedImage.trace();
and it's located one line before my code. By the way, I said earlier that other parameters like pathFidelity set without any problems.
oh, I see, sorry about that.
it could be a bug, I have tried to use TRACINGMODE without success in the past. I solved my problem by recording an Action to Trace the object, then have my script play the action.
How about to call a user defined preset
//var myOpts = thisImage.tracing.tracingOptions.loadFromPreset('Line Art'); var myOpts = thisImage.tracing.tracingOptions.loadFromPreset('User defined Preset');
CarlosCanto, It looks like a bug for me too. Thank you for a nice approach to playing action in the script. I'll definitely check it if I can't find out how it should work in the script.
pixxxel schubser, with predefined preset, I have another issue. When I load this preset in the script, it switches to a limited palette, with only 30 max colours. And my image is traced with this parameters. But when I load this preset in GUI, it works as expected.
Yes, I made an inaccuracy. What I meant:
I have a preset:
So in this preset Colors parameter equals to 40.
Also, I run this code:
And I have a result:
As you can see not only cornerFidelity has changed, but Colors too. And it stands for 100.
Previously, I tried to set colorMode, and I had this issue with limited colors.
And the main trouble - I don't know how to change Colors parameter from a script. Because in any case, it stands for 100. And I can see that there are no differences, despite my options.