0

我的目标是改变精灵的组织以供游戏阅读。我实现了几个命令:

convert skin.png -resize 133% skin-resize.png
convert skin-resize.png -crop 128x128+0+0 skin-resize-crop1.png
convert skin-resize.png -crop 128x128+128+0 skin-resize-crop2.png
convert skin-resize-crop2.png skin-resize-crop1.png +append montage.png
convert montage.png -background transparent -extent 256x256 -quality 0 montage_extend.png

精灵的新组织对我来说看起来不错,但是图像不再被我的游戏识别,那么我用windows软件打开它就没有问题了。我注意到,如果我用 Photoshop 打开图像,然后我备份图像,无需任何修改,图像就可以被我的游戏识别。我在 2 张图片上制作了“识别 -verbose”以查看差异,这是我注意到的:

使用 imagemagick 6.8.1-9 (windows 7) 生成的 montage_extend.png

Alpha: none   #00000000
Rendering intent: Perceptual
Gamma: 0.45455
Chromaticity:
  red primary: (0.64,0.33)
  green primary: (0.3,0.6)
  blue primary: (0.15,0.06)
  white point: (0.3127,0.329)
Interlace: None
Background color: black
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 680x340+256+0
Origin geometry: +256+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
  date:create: 2013-01-22T23:43:59+01:00
  date:modify: 2013-01-23T00:29:50+01:00
  png:bKGD                 : chunk was found (see Background color, above)
  png:cHRM                 : chunk was found (see Chromaticity, above)
  png:gAMA                 : gamma=0.45454544 (See Gamma, above)
  png:IHDR.bit_depth       : 8
  png:IHDR.color_type      : 6 (RGBA)
  png:IHDR.interlace_method: 0 (Not interlaced)
  png:IHDR.width,height    : 256, 256
  png:oFFs                 : x_off=256, y_off=0
  png:pHYs                 : x_res=7873, y_res=7873, units=1
  png:sRGB                 : intent=0 (Perceptual Intent)
  png:text                 : 2 tEXt/zTXt/iTXt chunks were found
  png:vpAg                 : width=680, height=340
  signature: c9aee1b8c3e1b8111a19eb1ec2a50b675eec067688f74363730c58857ea9c724
Artifacts:
  filename: montage_extend.png

montage_extend-ps.png(用photoshop保存的图像)

Alpha: srgba(255,255,255,0)   #FFFFFF00
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
  red primary: (0.63999,0.33001)
  green primary: (0.3,0.6)
  blue primary: (0.15,0.05999)
  white point: (0.31269,0.32899)
Interlace: None
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Compose: Over
Page geometry: 256x256+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
  date:create: 2013-01-23T00:30:40+01:00
  date:modify: 2013-01-23T00:30:42+01:00
  png:cHRM                 : chunk was found (see Chromaticity, above)
  png:IHDR.bit_depth       : 8
  png:IHDR.color_type      : 6 (RGBA)
  png:IHDR.interlace_method: 0 (Not interlaced)
  png:IHDR.width,height    : 256, 256
  png:pHYs                 : x_res=7873, y_res=7873, units=1
  signature: c121d0c36e1dca7f55fb4bd04f140614aa34210dab19c6f6d5031f63d0be4978
Artifacts:
  filename: montage_extend-ps.png

透明度看起来不同,但我不知道如何使用 Image Magick 转换我的图像以获得相同的结果。

PS:对不起我的英语:s

4

0 回答 0