Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TGA color-mapped files with expansion #38

Closed
walbourn opened this issue Sep 19, 2016 · 5 comments
Closed

Support TGA color-mapped files with expansion #38

walbourn opened this issue Sep 19, 2016 · 5 comments

Comments

@walbourn
Copy link
Member

The current TGA loader does not support TGA_COLOR_MAPPED or TGA_COLOR_MAPPED_RLE images. Legacy D3DX9 did support them, but loaded them as D3DFMT_P8 (i.e. 256-index palette).

While there are no palette DXGI formats, such TGA files could be expanded to B5G5R5A1_UNORM (bColorMapSize of 15 or of 16) or R8G8B8A8_UNORM (bColorMapSize of 24 or 32).

@walbourn
Copy link
Member Author

walbourn commented Sep 19, 2016

There's generally not much call for color-mapped TGA files as their primary value is being able to encode 24bpp or 32bpp pixel data. 8-bit palette textures are usually created as png or bmp which can already be expanded by DirectXTex.

@dingsheng999
Copy link

Thanks a lot Chuck for this great library. I tested DirectXTex for .tga sample files on http://www.fileformat.info/format/tga/sample/index.htm, and only one file, 'CCM8.TGA', cannot be correctly decoded because it's a color-mapped TGA. It's still nice to have DirectXTex support this kind of file so that people can use it as a general TGA reader, and along with other awesome functions such as pixel format conversion.

@walbourn
Copy link
Member Author

@dingsheng999 Thanks for the feedback. The vast majority of use-cases for TGA is 24bpp/32bpp bitmaps because at the time it was one of the few formats that supported it. I've also not found any examples of color-mapped TGA files except those sample files from the original test suite. Have you run across any others?

@dingsheng999
Copy link

@walbourn I tried to search on Bing, Baidu, Google and a even a few image websites for professional artists but cannot find a single real case color-mapped TGA file. That sample file is the only one I can find.

@walbourn
Copy link
Member Author

It seems like color-mapped TGAs just never got any real traction in the real world since other formats cover that scenario well. As such, I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants