Copy link to clipboard
Copied
Hi,
I have a load of pics of differing sizes that I want to increase in size by 20px all round. Is there an easy way to automate this (ie with an action) or do I need to use a script? It might be worth pointing out that I have very little knowledge of scripting so am hoping that an action will do the job!
Any help would be awesome. Thanks.
function rC(v) {return eval("aD." + v + ".as('px') + UnitValue('20 px')")}
(aD = activeDocument).resizeCanvas(rC('width'), rC('height'))
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html?m=1
Scripts are installed in the /Presets/Scripts folder
Mac OS Example:
/Applications/Adobe Photoshop CC 2018/Presets/Scripts
Win OS Example:
C:\Program Files\Adobe\Adobe Photoshop CC 2018\Presets\Scripts
Alternatively, select File > Scripts > Browse, and navigate to the script file.
You saved the file as RTF and not plain text.
You just need to record the action using the relative option;
Copy link to clipboard
Copied
function rC(v) {return eval("aD." + v + ".as('px') + UnitValue('20 px')")}
(aD = activeDocument).resizeCanvas(rC('width'), rC('height'))
Copy link to clipboard
Copied
Thanks kukurykus! You always have such a concise, “non-standard” coding style, similar to r-bin!
Copy link to clipboard
Copied
r-bin uses hard but understable codes. Mine are just wrote in specific for me style 😉
Copy link to clipboard
Copied
Thanks Kukurykus.
Where do I add that text?
:o/
Copy link to clipboard
Copied
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html?m=1
Scripts are installed in the /Presets/Scripts folder
Mac OS Example:
/Applications/Adobe Photoshop CC 2018/Presets/Scripts
Win OS Example:
C:\Program Files\Adobe\Adobe Photoshop CC 2018\Presets\Scripts
Alternatively, select File > Scripts > Browse, and navigate to the script file.
Copy link to clipboard
Copied
Legend! I'll give it a go, thanks.
Copy link to clipboard
Copied
Struggling to get that to work...
:o(
Copy link to clipboard
Copied
You saved the file as RTF and not plain text.
You just need to record the action using the relative option;
Copy link to clipboard
Copied
Stephen_A_Marsh said everything, so I added his answers to correct ones 😉
Copy link to clipboard
Copied
I’m not in front of a computer, however from memory you should be able to use a relative value to expand the canvas in an action without requiring a script.
EDIT: Now that I am in front of Photoshop, here is a visual:
Keep in mind that adding a uniform relative 20px is the total size, so that would be 10px on each edge.
Copy link to clipboard
Copied
That's right. An action, expanding by pixels in Canvas Size, is straightforward. A script is not necessary.
Copy link to clipboard
Copied
Thanks Kukurykus and Stephen_A_Marsh; the script (once I'd managed to make it!!) worked a treat, and I can't believe how many years I've used PhotoShop but never seen the "Relative" tick box in Canvas Size!! Apparently you can teach an old new tricks! LOL
Copy link to clipboard
Copied
Just remember every time you play or run a script or play an action like that editing a document the document canvas size will be increased. Actions that add mats and frames to images often use several such steps. And canvas added to a background layer will had some color.
Copy link to clipboard
Copied
I believe the simplest option is to create an Action to increase the Canvas size, and then you can Batch this will multiple files.
Copy link to clipboard
Copied
Thanks Joseph. Yet again, the Adobe Community fixes my problems super fast!!
Copy link to clipboard
Copied
Script can be automated by Batch too. Simply record it as an regular item.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now