如何判断 Targa 是否来自 Photoshop?
我在尝试编写 *.tga 文件阅读器时遇到了问题。对于 32 位 targas,photoshop 用 255 填充 alpha 通道,这仍然是标准的,并且可以工作,但在 16 位 targas 中,photoshop 用零填充 alpha 位。
有什么方法可以告诉我 Targa 来自 Photoshop,这样我就可以用 1 填充 alpha 位吗?
I have run into an issue while trying to write a *.tga file reader. For 32 bit targas, photoshop fills the alpha channel with 255, which is still standard, and works, but in 16 bit targas, photoshop fills the alpha bit with zeros.
Is there any way I can tell that a Targa has come from Photoshop so I can fill the alpha bit with 1s?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Targa 文件格式 2.0 版规范包含所谓的扩展区域,其中有一个软件ID字段。该字段保存创建该文件的应用程序的名称。
也许您可以检查 Photoshop 是否生成 2.0 版 Targa 文件,如果它执行什么软件 ID 写入此特定字段,然后在您的应用程序中检查此 ID。
由于 Targa 1.0 文件格式没有这样的字段,我不确定是否可以检测 Photoshop。
The version 2.0 specification of the Targa file format contains a so called Extension area which has a Software ID field. This field holds the name of the application that created the file.
Maybe you could check whether Photoshop produces version 2.0 Targa files, and if it does what Software ID does it write to this specific field, then in your application check for this ID.
As Targa 1.0 file format does not have such a field, I'm not sure whether detecting Photoshop is possible at all.