Padd icons with empty space using linux convert utility
-
11-12-2019 - |
Question
I have a bunch of PNG icons with different sizes:
96x96
96x23
96x46
96x80
etc...
How can I, with the help of linux convert
utility, padd them. So that all of the icons get the same square dimensions, say 96x96
.
The existing image should be centered. Like this (for the image of the size 5x5
):
.....
xxxxx
xxxxx
xxxxx
.....
I used the following command to scale the image. Maybe, I just forgot some parameter?
convert -size 96x96 icon.png -resize 96x96 +profile '*' scaled.png
Solution
This one should help:
convert \
icon.png \
-scale 96x96 \
-background white \
-gravity center \
-extent 96x96 \
+profile '*' \
scaled.png
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow