我的目标是将精灵的组织转换为游戏阅读。我意识到了几个命令:
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