Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vtf2png

A command-line tool to convert Valve Texture Format (VTF) files to PNG images.

Features

  • 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

Building

Prerequisites

  • CMake 3.16 or higher
  • C++17 compatible compiler (GCC 8+, Clang 7+, MSVC 2019+)

Build Instructions

# 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 .

Usage

# 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

Options

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)

Supported Formats

Format Support
DXT1
DXT3
DXT5
RGBA8888
BGRA8888
ABGR8888
ARGB8888
RGB888
BGR888
RGB565
BGR565
BGRA4444
BGRA5551
I8
IA88
A8
UV88

Dependencies

  • stb - For PNG writing (stb_image_write)
  • GLM - OpenGL Mathematics library

License

MIT License

About

A command-line tool to convert Valve Texture Format (VTF) files to PNG images

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages