A command-line tool to convert Valve Texture Format (VTF) files to PNG images.
- Supports VTF versions 7.0 through 7.5
- Handles common VTF image formats:
- Uncompressed: RGBA8888, BGRA8888, RGB888, BGR888, and more
- Compressed: DXT1, DXT3, DXT5
- Grayscale: I8, IA88, A8
- Various 16-bit formats
- Extract specific frames from animated textures
- Extract specific mip levels
- CMake 3.16 or higher
- C++17 compatible compiler (GCC 8+, Clang 7+, MSVC 2019+)
# Clone the repository with submodules
git clone --recursive https://github.com/yourusername/vtf2png.git
cd vtf2png
# Or if you already cloned without --recursive:
git submodule update --init --recursive
# Create build directory
mkdir build
cd build
# Configure and build
cmake ..
cmake --build .# Basic usage - converts input.vtf to input.png
./vtf2png input.vtf
# Specify output filename
./vtf2png input.vtf output.png
# Show VTF file information
./vtf2png -i input.vtf
# Extract specific frame (for animated textures)
./vtf2png -f 5 input.vtf output.png
# Extract specific mip level (0 = highest resolution)
./vtf2png -m 2 input.vtf output.png
# Show help
./vtf2png --help| Option | Description |
|---|---|
-h, --help |
Show help message |
-i, --info |
Show VTF file information |
-f, --frame N |
Extract frame N (default: 0) |
-m, --mip N |
Extract mip level N (default: 0) |
| Format | Support |
|---|---|
| DXT1 | ✅ |
| DXT3 | ✅ |
| DXT5 | ✅ |
| RGBA8888 | ✅ |
| BGRA8888 | ✅ |
| ABGR8888 | ✅ |
| ARGB8888 | ✅ |
| RGB888 | ✅ |
| BGR888 | ✅ |
| RGB565 | ✅ |
| BGR565 | ✅ |
| BGRA4444 | ✅ |
| BGRA5551 | ✅ |
| I8 | ✅ |
| IA88 | ✅ |
| A8 | ✅ |
| UV88 | ✅ |
MIT License