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

Batch image trace with transparent background

New Here ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

I have 1000 PNG files that need to be converted to SVG without background. The images are only 2-color silhouettes, so it's very easy to process with Image Trace preset. But the problem is that when batch processing with image trace, illustrator will not use the "ignore white" option which removes the background.

 

Is there a workaround to batch process PNG to SVG with "ignore white" enabled? I'm comfortable using javascript

 

Thanks

TOPICS
Feature request , Scripting

Views

6.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

correct answers 3 Correct answers

Community Expert , Jun 16, 2020 Jun 16, 2020

You could create a custom Image Trace preset that includes the Ignore White option.

In Bridge > Tools > Illustrator > Image Trace... you can select that preset for selected images.

You may need to apply a batch action to expand the tracing.

 

Votes

Translate

Translate
LEGEND , Jun 16, 2020 Jun 16, 2020

Yes, you can create a custom Image Trace preset, but at least in AI CC 2015 an Action will always use the default trace settings.

To get around this we edited the "Tracing Presets" file so the "Default" preset produces a transparent background (Black and White only).

 

This file is found in various locations depending on your system and AI version. Check this thread for help finding it:
How to share custom Image Trace Presets between users?

 

You can edit the "Vectorizing Presets" file in a text

...

Votes

Translate

Translate
Community Expert , May 20, 2023 May 20, 2023

No need for a script, just create an Action and use Batch:

https://helpx.adobe.com/illustrator/using/automation-actions.html

Votes

Translate

Translate
Adobe
Community Expert ,
Jun 16, 2020 Jun 16, 2020

Copy link to clipboard

Copied

You could create a custom Image Trace preset that includes the Ignore White option.

In Bridge > Tools > Illustrator > Image Trace... you can select that preset for selected images.

You may need to apply a batch action to expand the tracing.

 

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 ,
Jun 16, 2020 Jun 16, 2020

Copy link to clipboard

Copied

Yes, you can create a custom Image Trace preset, but at least in AI CC 2015 an Action will always use the default trace settings.

To get around this we edited the "Tracing Presets" file so the "Default" preset produces a transparent background (Black and White only).

 

This file is found in various locations depending on your system and AI version. Check this thread for help finding it:
How to share custom Image Trace Presets between users?

 

You can edit the "Vectorizing Presets" file in a text editor to get the "Default" Setting you need. Alternatively you could write a script to use ANY named preset and use the script in your batch operation. This is the JavaScript we use for this purpose. You might use a portion of it for your needs:

 

function traceFPrint(PIN) {
    // Trace PNG to Vector in Illustrator
    var aDoc = app.activeDocument;
    var Selected = aDoc.selection[0]
    var Tracing_Preset = '[Default]';
    var sel = aDoc.selection;
    var f = 15; //percent of current size  
    var pItems = aDoc.pageItems;
    //Scale Fingerprint  Image
    for (var i = 0; i < pItems.length; i++) {
        pItems[i].resize(f, f, true, true, true, true, f, Transformation.DOCUMENTORIGIN);
    };
    fitArtboards(app.activeDocument);
    // Trace Fingerprint  
    for (var i = 0; i < sel.length; i++) {
        if (sel[i] == '[RasterItem ]') {
            var pic = sel[i].trace();
            pic.tracing.tracingOptions.loadFromPreset(Tracing_Preset);
            pic.tracing.expandTracing().selected = true;
        }
    }
    aDoc.layers[0].groupItems[0].name = PIN;
    zoomToSelection ();
    aDoc.activeLayer.hasSelectedArtwork = false;
}

 

 

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
Enthusiast ,
Jul 17, 2020 Jul 17, 2020

Copy link to clipboard

Copied

There is a very simple solution to batch convert (image trace) with any settings you want, including the advanced "Ignore White" setting. If you have Illustrator 2020, here is how to do it: 

 

Open Illustrator (2020). Create a preset in Illustrator for tracing (goto "Windows > Image Trace"). I made a preset and called it "BW-No-White". The preset is set to convert to black and ignore white (= ignore white backgrounds).

 

Then open "Adobe Bridge". Within Bridge, go to the folder where you have your bitmaps that you would like to batch convert to vectors. Within Bridge, Select "Tools>Illustrator>Image Trace". Select your preset (which you set up prior in Illustrator). Set you destination folder and click OK. That's it. No need to script anything!

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 ,
Jul 19, 2020 Jul 19, 2020

Copy link to clipboard

Copied

@Red_Point, How do you share these custom settings with other users? I find it rather cumbersome to share custom "Trace" settings since it requires updating an "Preference" file buried in a Preference folder that is not well document (at least in older AI CC versions).

I also find it combursome to rely on a 2nd application for a routine Illustrator function such as "Trace". 

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
Enthusiast ,
Jul 19, 2020 Jul 19, 2020

Copy link to clipboard

Copied

I never really had to share my trace settings with anyone. Plus, sharing a preset in my case would be very easy, as it is "black" and "ignore whites". If you need to do more complex tracing, then I agree, it would be more convenient to have an "export preset" option.

 

I am also missing that in the "export for screens" dialog. I need to batch export different files sizes depending on the project I am working on. Right now, you can only set one default preset, which is very odd. Seems like the Illustrator dev team doesn't like the concept of saving presets. So I set it up to export 40 different sizes and then just delete the once I do not need. But I do always need to change the prefix naming conventions....

 

Regarding batch tracing, I am grateful that it is now possible to batch trace with any settings. That already helps me alot anyway. Saving presets (also to your own locations, locally and cloud) would be the icing on the cake.

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
New Here ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

Hello,

 

I  am trying to batch trace all images inside Adobe Bridge using Adobe Illustrator script.

I am able to batch trace and get .ai file output, but I want .svg instead. I have already created a custom preset in Adobe Illustrator for my needs. But tracing each image individually in Illustrator is a tedious process.

 

Please help me to change or write new script which I can use in Adobe bridge or Adobe Illustrator

Thank You

Soans

 

 

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 20, 2023 May 20, 2023

Copy link to clipboard

Copied

After tracing using Bridge, you can create an Action to export to SVG and use Batch on a folder of .ai files.

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
New Here ,
May 20, 2023 May 20, 2023

Copy link to clipboard

Copied

is it possible to convert .ai files to vectorized svg's?

please provide scripts if you can.

 

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 20, 2023 May 20, 2023

Copy link to clipboard

Copied

No need for a script, just create an Action and use Batch:

https://helpx.adobe.com/illustrator/using/automation-actions.html

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
New Here ,
May 20, 2023 May 20, 2023

Copy link to clipboard

Copied

Thank you very much.

This fixed my problem

 

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
New Here ,
May 20, 2023 May 20, 2023

Copy link to clipboard

Copied

hello,

 

The actions saves .ai to .svgs, but the tracing looses a lot of information and too much paths.

So, I created an action for directly tracing png and saving it into svg with presentation attributes for loading in blender. It still saves .ai files and sometimes .svgs but its not vectorized, quality is just like a png.

How can I solve this.

 

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 20, 2023 May 20, 2023

Copy link to clipboard

Copied

"the tracing looses a lot of information and too much paths"

Hard to say something about what we cannot see. Maybe you can show an example of your problem.

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
New Here ,
May 22, 2023 May 22, 2023

Copy link to clipboard

Copied

LATEST

hello.

 

sorry, it was the problem of tracing.

reducing the default noise parameter from 5px to 1px increased the paths from 10 to 5000

 

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