Skip to main content
brian_p_dts
Community Expert
Community Expert
January 3, 2024
Answered

Converting complex image trace to just outer path

  • January 3, 2024
  • 3 replies
  • 1912 views

This seems like it should be easy enough, but don't know enough Illustrator to do it. 

I am using Image Trace on a transparent placed png. Used the Low Quality Photo preset. Then I expanded it. I get this grouping after deleting the bottom path item (original white background). 
Edit: Added new post below with new explanation of the issue I'm facing -- 


I would like to stroke just the outer edge of this path (around the stump). What's the operation to merge all of these paths into one? I tried making a compound path but it still stroked the inside pieces. Or is there a better Image Trace preset I should use to just get the exterior. 

Thanks. 

 

This topic has been closed for replies.
Correct answer CarlosCanto

Setting Ignore White has been a problem like forever, but it got worse when Adobe update the feature to Ignore Colors. 

 

Check this thread for a possible solution

https://community.adobe.com/t5/illustrator-discussions/how-can-i-toggle-the-quot-ignore-color-quot-button-with-a-script/m-p/14185795#M385364

3 replies

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
January 4, 2024

Setting Ignore White has been a problem like forever, but it got worse when Adobe update the feature to Ignore Colors. 

 

Check this thread for a possible solution

https://community.adobe.com/t5/illustrator-discussions/how-can-i-toggle-the-quot-ignore-color-quot-button-with-a-script/m-p/14185795#M385364

Sergey Osokin
Inspiring
January 5, 2024

@brian_p_dts I'd also appreciate it if you could leave your vote on the Uservoice about tracing issues in the ExtendScript API.

brian_p_dts
Community Expert
Community Expert
January 7, 2024

Done, this is annoying. You're workaround to edit the .h file did not work for me. 

 

brian_p_dts
Community Expert
Community Expert
January 4, 2024

OK, so here is the latest. This has become more of a scripting questions. When I run the trace manually, I get the outline path the way I want it: 

I can unite this. However, when I run the same settings in my script, I am capturing the outer group, and the white space is expanding (note how small the artboard is in the image above). 

Here are the final settings I am using (copied from the good preset above): 

var topts = {
        tracingColorTypeValue: TracingColorType.TRACINGFULLCOLOR,
        palette: "NoLib",
        colorGroup: "All",
        tracingColors: 30,
        colorFidelity: 100,
        threshold: 128,
        grayLevels: 50,
        pathFidelity: 50,
        cornerFidelity: 75,
        noiseFidelity: 25,
        tracingMethod: TracingMethodType.TRACINGMETHODABUTTING,
        fills: true,
        strokes: false,
        maxStrokeWeight: 10,
        snapCurveToLines: true,
        ignoreWhite: false,
    }

Here's the preset: 

 

Monika Gause
Community Expert
Community Expert
January 3, 2024

In Image trace, trace Black and white (will work best or at all when the image has a white background or transparent)

Afterwards you can try and open Window Pathfinder and then click on the top left button Unite

brian_p_dts
Community Expert
Community Expert
January 4, 2024

Thanks Monika. I am trying to get a trace of the transparent png, but it's capturing the frame of the placed object (rectangle on outside). Really I just want an outline of the placed transparent PNG. Trying to re-create with scripting, but can't seem to get it to right. Not sure if you'e a scripter, but maybe someone else has some ideas of the options I can use: 

var gTracingOptions = {
        cornerFidelity: 75,
        ignoreWhite: true,
        noiseFidelity: 25,
        maxStrokeWeight: 1,
        minArea: 5,
        minStrokeLength: 1,
        outputToSwatches: true,
        palette: '',
        pathFidelity: 50,
        threshold: 128,
        tracingMode: TracingModeType.TRACINGMODEGRAY
    }
brian_p_dts
Community Expert
Community Expert
January 4, 2024

Correction, I got the trace I need. Is there a way to export the trace preset out and load them?