-
Notifications
You must be signed in to change notification settings - Fork 231
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
Error on --format R8G8B8A8_SRGB (v4.3.0-alpha3) #751
Comments
IINM |
No, that won't work. The current version of the KTX Tools has been designed to require the input content to match the output format in terms of component count and bit-depth (8bpp or 16bpp normalized data can come from PNG, while 16/32-bit float or integer data can come from EXR), thus unfortunately this is not currently supported. If support for having different component counts in inputs vs outputs is necessary (e.g. for the create and extract command) then that could be added as a feature request, as it would need a somewhat wider set of image transformations. Just adding such swizzling wouldn't be too difficult though. @lexaknyazev, FYI. |
Given that Metal (and therefore MoltenVK) does not support RGB textures being able to add an opaque alpha channel without needing to use an external tool seems an important feature to me. |
I don't disagree with that, in fact it's not specific to Metal, many desktop GPUs do not support RGB, only RGBA. I'm just stating that such functionality was not part of the original set of requirements as there was a 1-to-1 mapping from input image formats to output texture formats. |
In any case, I'll put together a PR for supporting this (with and without an explicit input swizzle parameter). |
I've created PR #755 to add support for this. Also added about 100 test cases covering the added new functionality (see CTS PR KhronosGroup/KTX-Software-CTS#3). |
I'm creating some PNG textures, and want to encode them as RGBA32. Commonly authoring tools will omit the alpha channel in the PNG, but I need that channel to be present in the encoded KTX2 data, so we get RGBA32 and not RGB32. Here's what I tried:
For both, I see this error:
My workaround for now is to use imagemagick to put an alpha channel into the source file, but ideally this could be done in the
ktx
CLI directly. I'm not sure whether the--input-swizzle
flag should be required here or not.Imagemagick:
Source image:
2d_rgb8.png.zip
The text was updated successfully, but these errors were encountered: