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

Recommended workflow for KTX/KTX2 files #338

Open
alecazam opened this issue Oct 20, 2020 · 8 comments
Open

Recommended workflow for KTX/KTX2 files #338

alecazam opened this issue Oct 20, 2020 · 8 comments

Comments

@alecazam
Copy link

I'm using KTX as a source and destination format for HDR and encoded textures, but do image editors like Photoshop have a plugin to export/edit these files? They seem to solely be relegated to a destination format without this kind of support.

There also don't seem to be any pixel editors that can work on mipmaps or HDR, and then save it back to KTX/KTX2. Also Windows thumbnail viewers seem to stop at PNG and DDS. ETC/PVRTC thumbnails on macOS aren't supported due to lack of a decoder. There aren't even any preview utilities for KTX2, and on macOS only ATSC is decoded, and BC is viewable in Preview. PVRTexToolGUI can open mips, but still can't display correct sRGB content, and displays block artifacts on anything larger than ASTC4x4 block sizes.

There just needs to be a little more tooling around KTX and KTX2 to help with all this workflow.

@MarkCallow
Copy link
Collaborator

MarkCallow commented Oct 20, 2020

We all agree that more tooling is needed. Photoshop has an API for image i/o as do the Autodesk products. If there were plugins providing these APIs then you could use the full power of the tools on KTX files. Similarly a Gimp plugin is seen as useful. One member has also recommended we add support to OpenImageIO (Homepage), (GitHub) which is used by professional tools. There has been some discussion in Khronos about funding efforts to jump start some of these things. I'm not sure there is much we can do about OS thumbnail previews though.

Take a look at the KTX wiki for a list of the currently known tools.

I was going to suggest for PVRTexToolGUI that you file bugs on the PowerVR forum. but I see you've already done that and I also see that they haven't exactly been responsive. I will talk to someone I know at Imagination.

@donmccurdy
Copy link
Contributor

There aren't even any preview utilities for KTX2

The BabylonJS sandbox (https://sandbox.babylonjs.com/) seems to do a good job of previewing 2D KTX2 files, within some constraints. I expect it is limited to Basis Universal texture formats, encoded in WebGL-compatible dimensions.

@alecazam
Copy link
Author

alecazam commented Feb 4, 2021

I finished a viewer for KTX/KTX2 textures. https://github.com/alecazam/kram It's not using libktx, but can display zstd compressed KTX2, just not Basis textures yet. I'll get there once I have the transcoder hooked up, or I add in libktx.

@MarkCallow
Copy link
Collaborator

@alecazam please add kram to the list of viewers in the KTX-Software wiki.

@alecazam
Copy link
Author

alecazam commented Feb 4, 2021

Added. I used Github Actions to generate some binary releases of kram for Win/macOS so that should make it easier to try out and use. It's also a universal build for M1.

@chriku
Copy link

chriku commented May 29, 2022

Similarly a Gimp plugin is seen as useful

I made a small proof of concept here: https://github.com/chriku/gimp-ktx
As libktx can already convert from compressed formats the import is mostly selecting the right gimp/babl format.
Same goes for the export, I just don't have any clue how to work the libktx compression functions

@MarkCallow
Copy link
Collaborator

Thank you for doing this. I wish you luck with progressing this.

When you wrote "As libktx can already convert from compressed formats" I was worried as there are many compressed formats that libktx cannot decompress. But I looked at your code and see that you are referring only to transcode of the BasisU formats. So no problem.

You need to very clear to your users that importing a BasisU compressed file and re-exporting the image as BasisU or ASTC will degrade the quality and should be avoided.

I also noticed a test for baseDepth=1 with an error saying invalid depth. You really need to say unsupported depth as deoth > 1 is valid for KTX and GPU APIs.

@atteneder
Copy link
Contributor

Corresponding OpenImageIO feature 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

5 participants