[Solved] Add Padding to Image?

Need to resize images of varying dimensions,
Fighting with Terminal, SIPS and KM,

This seems to not work in a KM Execute Shell script when I try to pass a variable called VarName

sips --padToHeightWidth 1300 1920 "$KMVAR_VarName" --out ~/Downloads/~tmp/test-out.png

Edit: In his infinite all-reaching grandiose magnificent wisdom, Peter had already included a useful image operation, it's called Resize Image action, including an option to Add Margins.

Thanks.

3 Likes

If you use the KM Editor shortcut key ⌃⌘A to Insert Action by Name, and then type in "image", you will see all of the Actions that can use images:

image

Note that some of these, like "Add or Remove Margins", are really options of the same parent Action, like "Resize Image"

image

image

1 Like

Thanks a lot! Very useful, also appreciated the Wiki update :+1:

1 Like