如何从 plist 文件中提取 png 图像?
我目前有一组 plist 文件。里面是png图片,有些文件有很多图片。我用的是win64 vista。
我已经寻找了专门为此目的的东西,例如 FileJuicer,但这仅适用于 mac 用户。
I currently have a set of plist files. Inside are png images, some files have numerous images. I'm using win64 vista.
I've looked for things specifically for this such as FileJuicer, but that is only for mac users.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我编写了此脚本来解压 TexturePacker
首先,确保 png 和 plist 文件都在同一目录中,在我的例子中: freeGifts.plist 和 freeGifts.png
其次,与 unpack_plist.py 相同的以下脚本
然后, python unpack_plist .py freeGifts,它会生成很多png文件到名为freeGifts的目录
要求:python,PIL
I have written this script to unpack
png
files in theplist
file packed by TexturePackerFirst, make sure you have both the png and plist files in the same directory, in my case: freeGifts.plist and freeGifts.png
Second, same the following script as unpack_plist.py
Then, python unpack_plist.py freeGifts, it will generate lots of png files to a directory named freeGifts
Requirement: python, PIL
哈哈,这都是史蒂夫·乔布斯所做的。您可以使用 ChadBurggraf 的库在 C# 中解析 plist https://github.com/ChadBurggraf/plists-cs。但正如评论中所讨论的,您想要的文件可能不在 plist 文件中。
Lol, this is all Steve Jobs' doing. You could parse the plist in C# using ChadBurggraf's library https://github.com/ChadBurggraf/plists-cs. But as discussed in the comments, the files you want probably aren't in the plist file.
感谢肖恩·Z。首先。
但我发现rotate不好,而且ygweric的patch也不够好。
因为当 png 包含 jpg 文件(模式 P)时,它会失败。有时透明会变成黑色背景。
我尝试修复此问题和我的代码如下:
Thanks to Sean.Z. first.
But I found that the rotate is not good, and ygweric's patch is not good enough.
because it will fail when the png include jpg file(mode P). and sometime Transparent will became black background.
I try to fix this and my code as below:
感谢 Sean.Z。
对于 unpack_plist.py,您需要:
1: PIL已安装在您的电脑上。
2:使用python 2.5
python2.5 unpack_plist.py Birdfly
否则你会失败。
-----2013-07-25--
对于一些旋转的plist,上面的脚本可能有一些错误。我将其修改如下:
Thanks to Sean.Z.
for the unpack_plist.py, you need:
1: PIL have been installed on you pc.
2: use python 2.5
python2.5 unpack_plist.py birdfly
or you will fail.
-----2013-07-25--
for some plist which is rotated, the above spcript may have some bugs. i modify it like following:
如果您的 PC 中有 JRE 或者您可能已经安装了 JRE,那么您可以使用我创建的工具来解压 .plist 文件。它还支持 LibGdx 项目中使用的 .pack 文件和 Unity 等许多引擎中使用的 .xml 文件来打包纹理。
https://github.com/itsabhiaryan/TextureUnPacker
If you have JRE in your PC or you may be install then you can use a tool which i create to unpack .plist file. It also has support .pack file that use in LibGdx projects and .xml file used in many engine like unity to pack texture.
https://github.com/itsabhiaryan/TextureUnPacker