Help with bash script and imagemagick for icon theme (again...)

I would like help to generate and modify this icon theme, i already learned how to apply patch and run the generate command, but i would like to add a border around each icon:
there’s some information on these links:

https://legacy.imagemagick.org/Usage/crop/#border

Here’s an example on what i would like to accomplish, i’ve added a blue background to make it easier to look:
example_1

example_2

this is the icon theme:

Do you want help, or do you want someone to provide the script that processes the files to your specification?

1 Like

i would like someone to provide the script or patch because i don’t know how to do it

Well, I can’t give you a complete script, but if you have an action you’d like to apply to multiple files separately, a general way to do that is with a for loop.

for filename in "${files[@]}"; do
  action "$filename"
done

Where files is an array of filenames, which you can generate in any way you want (either list the files individually, or get the result from the ls command, or use globbing (*) or whatever).

For example, if you’d like to append a line that says “Hello!” to the back of every .txt file in a directory, this would be the way to do it:

for filename in *.txt; do
  echo "Hello!" >> "$filename"
done

Now you should be able to do the same thing on your own, but with the proper Imagemagick command.

1 Like

Thanks, i actually tried something different, i picked the 16x16 icons and added a 22x22 frame size to each one of them, the problem is that the images had a link so if i tried to copy the contents from the 16x16 folder inside the 22x22 folder the images would get converted to 22x22 again :frowning:
I tried opening the png images on gimp but then when i tried to export the images would lose the anti-aliasing and get pixelated, my solution was to open image by image using pinta, increase the frame from 16x16 to 22x22 and save them so the images wound’t be link-type anymore, i’ve done that with about 200images so far but need to do more (the folder has about 600 icons), i’ve decided to do this because the original icons were too big for the drawing styleproject does for the toolbuttons and they look perfect with 16x16 icons:
before:


after: