SkillAgentSearch skills...

Vtf

Go package for parsing Source Engine textures (.vtf)

Install / Use

/learn @Galaco/Vtf
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GoDoc Go report card GolangCI Build Status codecov CircleCI

vtf

0 dependency parser for Valves own .vtf (Valve Texture Format) Source Engine textures.

Features

  • Supports versions 7.1-7.5
  • Full header data
  • Low resolution thumbnail loading
  • Complete mipmap + high-resolution texture loading

Usage

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)
  }
}

Whats missing

  • 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

What won't this ever do?

  • Colour format transformation. Header properties LowResImageFormat and HighResImageFormat will provide the format.
  • (Probably) support depths or zslices > 1

Contributing

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.

View on GitHub
GitHub Stars13
CategoryDevelopment
Updated1mo ago
Forks2

Languages

Go

Security Score

95/100

Audited on Mar 3, 2026

No findings