Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Image trace in js script

Community Beginner ,
Dec 27, 2016 Dec 27, 2016

Hi!

I'm trying to trace a PNG image in Adobe Illustrator via js script. I've tried different approaches, but always have the same problem - I can't change Color setting automatically. Here is my simple script:

thisImage.tracing.tracingOptions.tracingMethod = TracingMethodType.TRACINGMETHODABUTTING;

thisImage.tracing.tracingOptions.tracingMode = TracingModeType.TRACINGMODECOLOR;thisImage.tracing.tracingOptions.cornerFidelity = 50;thisImage.tracing.tracingOptions.pathFidelity = 55;thisImage.tracing.tracingOptions.noiseFidelity = 5;thisImage.tracing.tracingOptions.maxColors = 40;thisImage.tracing.tracingOptions.colorFidelity = 50;app.redraw();

So other parameters were changed during this script execution (Paths, Corners, Noise), but Colors is 100 again despite maxColors and colorFidelity. And I don't see any additional fields in tracing options that can be responsible for this.

Снимок.PNG

Could you please give me any advise how to solve this issue?

TOPICS
Scripting
4.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Dec 27, 2016 Dec 27, 2016

I'm just learning

What's the advantage here to making a Script

vs making an Action  with those image trace settings added via a  preset ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 28, 2016 Dec 28, 2016

I need to run this script in command line. So, I want to run it like "illustrator.exe trace.js", Illustrator opens my image, trace it and save the result. In case of actions, I need to use GUI.

By the way, traceOptions has the method to load preset, but for some reason when I load my preset in script - I have another issue. My palette switches to Limited palette with 30 max colors. So I can't use preset in js script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2016 Dec 28, 2016

You might try asking in the Illustrator Scripting Forum, one door down.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2017 May 25, 2017

What is "traceOptions"? I wasn't able to find a script by that name online.

I'm looking for a Script or Action solution to run more than one image trace preset in a single file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2017 May 25, 2017

traceOptions is just the name of the attributes in JS, not a particular script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2017 May 25, 2017

Actions do not recognize Image Trace Presets. It simply runs the default preset.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2017 May 25, 2017

Thanks, Doug. Showing my lack of JS knowledge. I'll poke around and see what I can learn about it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2017 May 25, 2017

i keep a copy of the scripting reference on hand to, er, reference.

though i'm no real scripter, it's useful to know what's possible and get familiar with the vocabulary.

Illustrator Scripting | Adobe Developer Connection

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
May 25, 2017 May 25, 2017
LATEST

Moving to Illustrator Scripting​ for further assistance.

Regards,

Om

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines