Is there a way to apply Oil Paint filter with JavaScript in Photoshop?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

janfe
Posts: 1
Joined: Fri Dec 23, 2016 6:33 pm

Is there a way to apply Oil Paint filter with JavaScript in Photoshop?

Post by janfe »

Is there a way to apply Oil Paint filter with JavaScript in Photoshop??
How to implement this filter into script.
Does anyone know how to do that?

Thanks.
User avatar
Chris_Kalmar
Posts: 12
Joined: Wed Dec 14, 2016 9:51 pm

Re: Is there a way to apply Oil Paint filter with JavaScript in Photoshop?

Post by Chris_Kalmar »

You can convert any action, filter into reusable jsx script. try to check http://ps-scripts.sourceforge.net/xtools.html

It's easy to use!

c
xbytor
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Re: Is there a way to apply Oil Paint filter with JavaScript in Photoshop?

Post by xbytor »

Basically, if you can record in an action, you can get JS code for it. The simplest way is using the SL Plugin and get code that way. The alternative is to record an action and use xtools to convert it to JS code as the previous post suggested.
pixxxelschubser
Posts: 26
Joined: Mon Aug 01, 2016 8:59 pm

Re: Is there a way to apply Oil Paint filter with JavaScript in Photoshop?

Post by pixxxelschubser »

janfe wrote:… Does anyone know how to do that? …
This way?

Code: Select all

var oilPaintFilter = new ActionDescriptor();
oilPaintFilter.putDouble( stringIDToTypeID('stylization'), 2.5);
oilPaintFilter.putDouble( stringIDToTypeID('cleanliness'), 2.3 );
oilPaintFilter.putDouble( stringIDToTypeID('brushScale'), 0.8);
oilPaintFilter.putDouble( stringIDToTypeID('microBrush'), 10 );
oilPaintFilter.putBoolean( stringIDToTypeID('lightingOn'), true );
oilPaintFilter.putInteger( stringIDToTypeID('lightDirection'), -60 );
oilPaintFilter.putDouble( stringIDToTypeID('specularity'), 1.3 );
executeAction( stringIDToTypeID('oilPaint'), oilPaintFilter, DialogModes.NO );
Have fun
;)