Copy link to clipboard
Copied
Hi!
Would it be possible to accomplish sort of what the spatter filter does (roughening up vector shapes to make them look more true to a pixels based scan), but with objects accessible to DOM scripting? I suppose I could try using interface scripting just for the spatter filter, but I would prefer to use code I actually understand...
Thanks!
Joakim
Like so many things in Photoshop scripting, I don’t believe that it is available via the DOM, which leaves AM code.
Spray Radius = 10
Smoothness = 5
spatterFilter(10, 5);
function spatterFilter(radiusValue, smoothnessValue) {
var idGEfc = charIDToTypeID( "GEfc" );
var desc533 = new ActionDescriptor();
var idGEfk = charIDToTypeID( "GEfk" );
var idGEft = charIDToTypeID( "GEft" );
var idspatter = stringIDToTypeID( "spatter" );
desc533.putEnumerated( idGEfk, id
...
Copy link to clipboard
Copied
Like so many things in Photoshop scripting, I don’t believe that it is available via the DOM, which leaves AM code.
Spray Radius = 10
Smoothness = 5
spatterFilter(10, 5);
function spatterFilter(radiusValue, smoothnessValue) {
var idGEfc = charIDToTypeID( "GEfc" );
var desc533 = new ActionDescriptor();
var idGEfk = charIDToTypeID( "GEfk" );
var idGEft = charIDToTypeID( "GEft" );
var idspatter = stringIDToTypeID( "spatter" );
desc533.putEnumerated( idGEfk, idGEft, idspatter );
var idsprayRadius = stringIDToTypeID( "sprayRadius" );
desc533.putInteger( idsprayRadius, radiusValue );
var idsmoothness = stringIDToTypeID( "smoothness" );
desc533.putInteger( idsmoothness, smoothnessValue );
executeAction( idGEfc, desc533, DialogModes.NO );
}
EDIT: Another option to roughen is Pixelate > Crystallize
crystallizeFilter(3);
function crystallizeFilter(crystallizeValue) {
var idcrystallize = stringIDToTypeID( "crystallize" );
var desc569 = new ActionDescriptor();
var idcellSize = stringIDToTypeID( "cellSize" );
desc569.putInteger( idcellSize, crystallizeValue );
executeAction(idcrystallize, desc569, DialogModes.NO);
}
Copy link to clipboard
Copied
Well, I suppose I've taken DOM scripting as far as I can, then! Thank you for the code! Both functions work wonderfully!
Copy link to clipboard
Copied
I am afraid the alternatives (Displace for example) might ultimately be more bother than the result is worth in this case.
I would recommend just wrapping the ScriptingListener.plugin-created AM code in a function that takes the two values as arguments.
Copy link to clipboard
Copied
I'll do that! Thanks!