2011-11-17 250 views
4

我一直在使用终端转换我叫左pvrtc格式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 
+0

可能使用http://stackoverflow.com/questions/6671680/pvr-texturetool-build-phase。那么,你在图像的完整路径中是否有空间? – occulus

回答

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是一些文档

HEREPVRTC东西

一个良好的阅读
相关问题