logo vmapp.org

 query : Photoshop script to select/average/deselect automatically I am currently working on an image (wallpaper for personal use) based on lowpoly graphics. When creating the lowpoly part, I have created


Posted in: #AdobePhotoshop #Automation #PhotoshopScripting #Selections

I am currently working on an image (wallpaper for personal use) based on lowpoly graphics. When creating the lowpoly part, I have created several triangular shapes, covering the part I wish to 'transform'. Since the image is not that big, I only made around 350 shapes, yet this is still a lot of selecting, averaging, and deselecting.

Recently I became aware of scripts in PS, and figured maybe using this function could be the solution - as in "Do it once, apply script, job done!".

Is this possible, or do I just have to work through it? I will probably be doing more of this sort of work, is there an "easy"/smart solution?

10.02% popularity Vote Up Vote Down



Sorted by latest first Latest Oldest Best



A 2 year old question, the system wants something. Here is:

Scripting can be useful, but it can be used to decide also the polygons. What's best, Adobe has thought it and included something to try.

An example:

The image is a well known image example from Windows. It's right half is filtered with Filter > Pixelate > Crystallize. It seems to divide the image to 3...5 sided polygons which are averaged. Polygon size is selectable, but the algorithm is fixed.

Your own attempt seems to have strokes. That effect can be simulated, too. One possiblity is to use one of Photoshop's egde emphasizing filters:

The crystallized image layer is duplicated and filter Glowing Edges is applied. The filtering result is mainly black, so blending mode Add is used. The opacity is reduced to keep the effect subtle.

Low poly art needs some interactivity in the triangulation process. No automate can do the decisions as a human. Crystallized image surely hasn't the same impact as a manually done. The difference is huge when the image has recognizable parts such as faces and everyday things.

There's plenty of software available for more intelligent automatic processing and also to help the manual process. (you also wanted one, namely one click averaging of the created triangles). Do some web searches for Triangulation and Low Poly software. There are plenty of plugins available - free and paid and even some online apps.

See this link: www.vectorgraphit.com/applications-to-create-geometric-low-poly-art/amp. GIMP has some tools for it, too and it's free.

10% popularity Vote Up Vote Down




Scripting is definitely the solution for reducing repetitive work. However, if you have not done any scripting before (in any context) and/or you have not scripted Photoshop before, then no, it won’t be “easy.”

To get started scripting Photoshop, you will want the Scripting Guide that goes with your version of Photoshop. For example, here is the one for Photoshop CC:

Photoshop CC Scripting Guide

Then you have to choose the language you are going to write scripts in. Basically, you can script Photoshop with Web scripting (JavaScript) or Mac scripting (AppleScript) or Windows scripting (VBScript.) If you are not sure, then you probably want to use JavaScript.

One way to get started with scripting is to use the “do action” command a lot. Then you can create Actions in Photoshop, and write scripts that for example, open a document, run 3 Actions on it, export a copy, and close the original document without saving. That way, fairly simple scripts can do very sophisticated things because they are running sophisticated Actions.

Sample javascript ( .jsx ):

The script loops through all immediate child layers of the group: My Group and runs action: My Action from the action folder: My Action Folder.

var doc = app.activeDocument,
layers = doc.layerSets.getByName( "My Group" ).artLayers;

for ( var i=0; i < layers.length; i++ ) {

doc.activeLayer = layers[ i ];

app.doAction("My Action", "My Action Folder");


10% popularity Vote Up Vote Down


Back to top | Use Dark Theme