我有一堆不同大小的PNG图标:
96x96
96x23
96x46
96x80
etc...
在linux convert
实用程序的帮助下,我怎样才能填充它们。因此,所有图标都具有相同的方形尺寸,例如96x96
。
现有图像应居中。像这样(对于大小为5x5
的图像):
.....
xxxxx
xxxxx
xxxxx
.....
我使用以下命令缩放图像。也许,我刚忘了一些参数?
convert -size 96x96 icon.png -resize 96x96 +profile '*' scaled.png
答案 0 :(得分:1)
这个应该有所帮助:
convert \
icon.png \
-scale 96x96 \
-background white \
-gravity center \
-extent 96x96 \
+profile '*' \
scaled.png