ios – 如何将图像转换为PVRTC格式

ios – 如何将图像转换为PVRTC格式,第1张

概述我一直在使用终端将名为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 perf 我一直在使用终端将名为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
解决方法 更改:

/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回到你的root并运行工具,如:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC –bits-per-pixel-2 -f PVR -o [pvr去的新路径] [原来的路径]

您的输出pvr路径可以是〜/ whatever / image.pvr,输入png是要转换的图像的路径.

HERE和HERE是其他很好的演练

The iPhone SDK includes a tool that allows you to create textures in the PVRTC compression format,aptly named texturetool. If you have Xcode installed with the iPhone OS 2.2 SDK in the default location (/Developer/Platforms/),then texturetool is located at: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool.

texturetool allows you to create four variants of PVRTC data,the primary difference being tradeoffs between quality and size. You will have to experiment with these variants to determine which setting is the best compromise for each indivIDual texture image.

> Apple Docs

HERE是一些相同的代码,一旦你有了你的pvrtc文件就可以提供帮助

HERE是一些更多的文档

HERE是关于PVRTC的好东西

总结

以上是内存溢出为你收集整理的ios – 如何将图像转换为PVRTC格式全部内容,希望文章能够帮你解决ios – 如何将图像转换为PVRTC格式所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1006502.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存