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

Image trace in js script

Community Beginner ,
Dec 27, 2016 Dec 27, 2016

Copy link to clipboard

Copied

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

Views

4.0K

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 ?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Moving to Illustrator Scripting​ for further assistance.

Regards,

Om

Votes

Translate

Translate

Report

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