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

Alternative to the spatter filter, for use with DOM scripting?

Participant ,
Jul 17, 2023 Jul 17, 2023

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

TOPICS
Actions and scripting

Views

253
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 1 Correct answer

Community Expert , Jul 18, 2023 Jul 18, 2023

@hertze 

 

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

Votes

Translate
Adobe
Community Expert ,
Jul 18, 2023 Jul 18, 2023

Copy link to clipboard

Copied

@hertze 

 

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);
}

 

 

Votes

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
Participant ,
Jul 18, 2023 Jul 18, 2023

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!

Votes

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 ,
Jul 18, 2023 Jul 18, 2023

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. 

Votes

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
Participant ,
Jul 18, 2023 Jul 18, 2023

Copy link to clipboard

Copied

LATEST

I'll do that! Thanks!

Votes

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