Image MIME Reference
KTX
Khronos Texture
image/ktx
VS
X Pixmap
image/x-xpixmap
XPM
A complete technical comparison of Khronos Texture and X Pixmap — covering compression, feature support, browser compatibility, magic bytes, and when to choose each format.
Equal browser support
Feature Support
| Feature | KTX | XPM |
|---|---|---|
| Transparency (Alpha) | Yes | Yes |
| Animation Support | ✕ No | ✕ No |
| Progressive Loading | ✕ No | ✕ No |
| HDR Support | Yes | ✕ No |
| EXIF Metadata | ✕ No | ✕ No |
| ICC Color Profile | ✕ No | ✕ No |
Khronos Texture
image/ktx
Extension
.ktx
Container
KTX (Khronos Texture 1.1)
Compression
Uncompressed / GPU Compressed (ASTC, ETC, BCn, PVRTC)
Algorithm
ASTCETC1 / ETC2BCn (DXT)PVRTCBasis Universal (in KTX2)
Color Depth
8-bit, 16-bit, 32-bit (Integer/Float)
Developed by
Khronos Group
Released
2010
Magic Bytes
AB 4B 54 58 20 31 31 BB 0D 0A 1A 0A
X Pixmap
image/x-xpixmap
Extension
.xpm
Container
C Source Code Header (.c / .h)
Compression
Uncompressed (Source Code)
Algorithm
None
Color Depth
Indexed Color (Custom Palette with RGB and Alpha 'None')
Developed by
Daniel Dardailler and Colas Nahaboo (Bull / X Consortium)
Released
1989
Magic Bytes
2F 2A 20 58 50 4D 20 2A 2F (ASCII '/* XPM */')
Browser Support Comparison
| Browser | KTX | XPM |
|---|---|---|
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ | ✕ |
|
|
✕ |
✓
|
KTX
KTX Strengths
- Enables direct-to-GPU texture uploading, drastically reducing load times and CPU overhead in 3D applications
- Supports complex texture types natively (mipmaps, cubemaps, 3D volumes, texture arrays)
- Standardized across major Khronos APIs (OpenGL, Vulkan, WebGL) unlike vendor-specific formats like DDS
Limitations
- Requires custom JavaScript loaders to parse and display on the web
- Zero native support in consumer image viewers or 2D photo editing software
- Format fragmentation: a KTX file containing an ASTC payload will fail to render on hardware that only supports BCn compression (KTX2 and Basis Universal solve this)
XPM
XPM Strengths
- Can be compiled directly into C or C++ source code without requiring an external asset loading mechanism
- Human-readable palette mapping allows developers to inspect, modify, or hand-craft icons directly within a text editor
- Native support for color palettes and transparency via the 'None' keyword
Limitations
- Extremely inefficient storage structure for large images, resulting in massive file bloat compared to binary formats like PNG
- Completely obsolete and unsupported in modern web browsers
- Parsing overhead requires compiling or interpreting text-based color tables at runtime
When to choose which format
KTX
Use KTX when…
- Real-time 3D Graphics
- WebGL / WebGPU Applications
- Mobile Games
- Virtual/Augmented Reality (VR/AR)
XPM
Use XPM when…
- X Window System (X11) Application Icons and Cursors
- Embedded C/C++ Firmware Color UI Assets
- Early Linux Desktop Environment Themes