与空的空间的Padd象使用linux转换实用程序

时间:2012-09-30 13:10:25

标签: android linux image imagemagick imagemagick-convert

我有一堆不同大小的PNG图标:

96x96
96x23
96x46
96x80
etc...

在linux convert实用程序的帮助下,我怎样才能填充它们。因此,所有图标都具有相同的方形尺寸,例如96x96

现有图像应居中。像这样(对于大小为5x5的图像):

.....
xxxxx
xxxxx
xxxxx
.....

我使用以下命令缩放图像。也许,我刚忘了一些参数?

convert -size 96x96 icon.png -resize 96x96 +profile '*' scaled.png

1 个答案:

答案 0 :(得分:1)

这个应该有所帮助:

convert             \
   icon.png         \
  -scale 96x96      \
  -background white \
  -gravity center   \
  -extent 96x96     \
  +profile '*'      \
   scaled.png