0 dependency parser for Valves own .vtf (Valve Texture Format) Source Engine textures.
- Supports versions 7.1-7.5
- Full header data
- Low resolution thumbnail loading
- Complete mipmap + high-resolution texture loading
import (
"github.com/galaco/vtf"
"log"
"os"
)
func main() {
file,_ := os.LoadFile("foo.vtf")
texture,err := vtf.ReadFromStream(file)
if err != nil {
log.Println(err)
} else {
log.Println(texture.Header().Width)
}
}
- Resource data is ignored (besides mipmaps) in 7.3+
- Texture with depth > 1 are unsupported. This is very rare
- Textures with zslices > 1 are unsupported. This is very rare
- Modify/export functionality
- Colour format transformation. Header properties
LowResImageFormat
andHighResImageFormat
will provide the format. - (Probably) support depths or zslices > 1
No where near all the possible texture configurations have been tested. It's possible some could cause issues. Any issues (including offending file) are greatly appreciated.