Sg2.9
Tracing Rasters
Recent RSS
Tracing Rasters
From:  Ray
Date:  8. February 2013, 07:09

I'm having trouble using the trace function. I can get it to livetrace a raster image but I can't seem to adjust any of the properties (blur, min path size, etc.). Can anyone offer any help? Thanks a lot.

Re: Tracing Rasters
From:  pqbd
Date:  9. February 2013, 05:26

How have you been trying to change them? Setting something like "tracing.blur = 10;" seems to work fine.

Re: Tracing Rasters
From:  Ray
Date:  9. February 2013, 10:27

Thanks, but to tell you the truth I can't seem to get anything to work.

Say I wanted trace any raster object on a particular layer and set the the blur property to 10 and the resample to 150?

I've got some cool ideas and can think of step by step methods to achieve them but when it comes to writing the code, I trip all over the syntax and structure.

Any help would be awesome. I've attached a sample of what my end product will do to photos. Kinda of a manic painting style. I can do it manually, probably even set up an action to do it but I want to eventually make some animations with it and getting it in script form would be a lot more efficient.

Re: Tracing Rasters
From:  pqbd
Date:  9. February 2013, 23:26

This will trace every raster item in the currently selected layer:

var sel = document.getItems({
type: 'Raster'
});
for (i=0, l=sel.length; i<l; i++){
if (sel[i].layer.active == true){
var tracing = new Tracing(sel[i]);
tracing.mode = 'color';
tracing.blur = 10;
tracing.resampleResolution = 150;
}
}

If you want it to run through every raster item in the document across all layers, just remove lines 5 and 10.

Re: Tracing Rasters
From:  Ray
Date:  10. February 2013, 12:41

Thanks. I'll have more questions as I keep going but I wanted to let you know that this helped a lot.

Re: Tracing Rasters
From:  Ray
Date:  11. February 2013, 13:18

If you have a second...
Is there a simple way to get this to work with Raster items and PlacedFile items? I've tried using " || " in the "type" input but then the script stops working. I can get it to work with either separately though.

Is there a way to "ignore white" with the tracing function?

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Abstract Foliage 18.08.08