如何将图像转换为PVRTC格式

时间:2011-11-17 20:52:44

标签: ios iphone xcode pvrtc

我一直在使用终端将名为left的jpg图片转换为pvrtc格式,这种情况会发生:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvrtc left.jpg  
Failed to load image  
Failed to perform Encode

1 个答案:

答案 0 :(得分:2)

变化:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvrtc left.jpg

要:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -o left.pvr left.PNG

该文件必须是PNG

更新了OSX 10.10 +

的说明

在终端中,点击cd以确保您位于根目录中。

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ && ls

这应该会显示所有工具的列表(确保您看到texturetool) - 如果不这样做,请更新您的操作系统,然后更新Xcode

一旦你知道它在那里,cd回到你的根并运行工具,如:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-2 -f PVR -o [new path to pvr to go] [path of original png]

您的输出 pvr路径可以是~/whatever/image.pvr输入 png是您的图片的路径转换。

HEREHERE是其他不错的演练

  

iPhone SDK包含一个工具,允许您以PVRTC压缩格式创建纹理,恰当地命名为texturetool。如果您在默认位置(/ Developer / Platforms /)安装了带有iPhone OS 2.2 SDK的Xcode,则texturetool位于:/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool

     

texturetool允许您创建PVRTC数据的四种变体,主要区别在于质量和大小之间的权衡。您将不得不尝试这些变体来确定哪个设置是每个纹理图像的最佳折衷方案。

HERE与您拥有pvrtc文件

后的代码相同

HERE是更多文档

HERE很好地阅读了PVRTC内容

相关问题