No vtf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Update help to version 3.1.0)
Line 13: Line 13:
   searched for .vtf files, symbolic links are not followed). Multiple paths
   searched for .vtf files, symbolic links are not followed). Multiple paths
   may be provided.
   may be provided.
  As the output path, it is possible to specify either file or directory.
  Specifying the output file is useful mostly for single-file conversions,
  with filters to ensure only a single image will be written.


   If the output directory is not specified, images are output into the source
   If the output directory is not specified, images are output into the source
Line 29: Line 34:
   (roughly, if it contains "hdr" near the end), or can be set manually.
   (roughly, if it contains "hdr" near the end), or can be set manually.


   Only the highest-resolution mipmap is extracted by default. Alternatively,
   It is possible to filter images to convert by min/max resolution (width &
  all mipmaps of the high-resolution image can be extracted.
  height), and by frames/faces/slices. The former supports exact or closest
  match. The latter supports selection by single index or via Python slicing:
  https://python-reference.readthedocs.io/en/latest/docs/brackets/slicing.html
 
  Face index mapping: right (0), left, back, front, up, down, sphere map (6).
 
  After applying filters, only the highest-resolution mipmap is converted by
  default. Alternatively, all mipmaps of the high-resolution image can be
  converted.
 
  Animated textures have frames converted into individual images by default.
  They can also be converted into an animated image file. When the latter is
  chosen, APNG is used as the default LDR image format instead of TIFF.


   The RGB/L and A channels are packed into one file by default. When output
   The RGB/L and A channels are packed into one file by default. When output
Line 48: Line 65:


Options:
Options:
   -o, --output-dir DIRECTORY     Output directory
   -o, --output-dir DIRECTORY     Output directory
   -l, --ldr-format TEXT         LDR output format  [default: tiff]
  --output-file FILE              Output file
   -h, --hdr-format TEXT         HDR output format  [default: exr]
   -l, --ldr-format TEXT           LDR output format  [default: tiff|apng]
   -d, --dynamic-range [ldr|hdr] Override LDR/HDR auto-detection
   -h, --hdr-format TEXT           HDR output format  [default: exr]
   -m, --mipmaps                 Extract all mipmaps
   -d, --dynamic-range [ldr|hdr]   Override LDR/HDR auto-detection
   -s, --separate-channels       Output the RGB/L and A channels separately
   -m, --mipmaps                   Extract all mipmaps
   -O, --overbright-factor FLOAT Multiplicative factor used for decoding
  --min-resolution INTEGER        Minimum mipmap resolution  [x>=1]
                                compressed HDR textures  [default: 16]
  --max-resolution INTEGER        Maximum mipmap resolution  [x>=1]
   --compress / --no-compress     Control lossless compression
  --closest-resolution            Fallback to closest resolution if no exact
   --always-write / --no-write   Write images
                                  match
   --readback / --no-readback     Readback images
  --frames INDEX|[START]:[STOP][:STEP]
   --num-workers INTEGER         Number of workers for parallel conversion
                                  Frames to extract
                                [x>=1]
  --faces INDEX|[START]:[STOP][:STEP]
   --no-progress                 Do not show the progress bar
                                  Faces to extract
   --version                     Show the version and exit.
  --slices INDEX|[START]:[STOP][:STEP]
   --credits                     Show the credits and exit.
                                  Slices to extract
   --help                         Show this message and exit.
  -a, --animate                  Output animated image file instead of
                                  writing each frame individually
  -F, --fps INTEGER              Frame rate used for animated image files
                                  [default: 5]
   -s, --separate-channels         Output the RGB/L and A channels separately
   -O, --overbright-factor FLOAT   Multiplicative factor used for decoding
                                  compressed HDR textures  [default: 16.0]
   --compress / --no-compress     Control lossless compression
   --always-write / --no-write     Write images
   --readback / --no-readback     Readback images
   --num-workers INTEGER           Number of workers for parallel conversion
                                  [x>=1]
   --no-progress                   Do not show the progress bar
   --version                       Show the version and exit.
   --credits                       Show the credits and exit.
   --help                         Show this message and exit.
</nowiki>}}
</nowiki>}}



Revision as of 12:38, 1 July 2023

Stub

This article or section is a stub. You can help by expanding it.

no_vtf is an open source alternative to VTF2TGA. Unlike its first-party counterpart, it also supports converting VTFs to PNG, TIFF, and EXR, and can also decompress compressed HDR skybox textures.

Tip.pngTip:Compressed HDR textures are automatically detected by the presence of the string "hdr" near the end of the filename.

Help text

Template:Permission Help from no_vtf run without an input file:

Usage: no_vtf [OPTIONS] PATH... Convert Valve Texture Format files into standard image files. PATH can be either file, or directory (in which case it is recursively searched for .vtf files, symbolic links are not followed). Multiple paths may be provided. As the output path, it is possible to specify either file or directory. Specifying the output file is useful mostly for single-file conversions, with filters to ensure only a single image will be written. If the output directory is not specified, images are output into the source directories. Otherwise, directory tree for any found files will be reconstructed in the chosen directory. Output LDR/HDR format is selected by its common file name extension. Special formats: "raw" to write the high resolution image data as-is; "skip" to skip the write step entirely. For supported formats, compression is controlled when saving the image. Lossless compression is enabled by default. Lossy compression is not used. The BGRA8888 format can store both LDR and compressed HDR images. The specific type is either auto-detected by looking at the input file name (roughly, if it contains "hdr" near the end), or can be set manually. It is possible to filter images to convert by min/max resolution (width & height), and by frames/faces/slices. The former supports exact or closest match. The latter supports selection by single index or via Python slicing: https://python-reference.readthedocs.io/en/latest/docs/brackets/slicing.html Face index mapping: right (0), left, back, front, up, down, sphere map (6). After applying filters, only the highest-resolution mipmap is converted by default. Alternatively, all mipmaps of the high-resolution image can be converted. Animated textures have frames converted into individual images by default. They can also be converted into an animated image file. When the latter is chosen, APNG is used as the default LDR image format instead of TIFF. The RGB/L and A channels are packed into one file by default. When output separately, resulting file names will be suffixed with "_rgb", "_l" or "_a". By default, image files are only written if they do not exist already. Alternatively, they can be overwritten, or writing can be disabled entirely. Images can be also read back to verify they have been written properly. Readback will error if data to be written do not match what is in the file. Worker is spawned for each logical core to run the conversion in parallel. Number of workers can be overridden. If set to 1, conversion is sequential. Exit status: Zero if all went successfully, non-zero if there was an error. Upon a recoverable error, conversion will proceed with the next file. Options: -o, --output-dir DIRECTORY Output directory --output-file FILE Output file -l, --ldr-format TEXT LDR output format [default: tiff|apng] -h, --hdr-format TEXT HDR output format [default: exr] -d, --dynamic-range [ldr|hdr] Override LDR/HDR auto-detection -m, --mipmaps Extract all mipmaps --min-resolution INTEGER Minimum mipmap resolution [x>=1] --max-resolution INTEGER Maximum mipmap resolution [x>=1] --closest-resolution Fallback to closest resolution if no exact match --frames INDEX|[START]:[STOP][:STEP] Frames to extract --faces INDEX|[START]:[STOP][:STEP] Faces to extract --slices INDEX|[START]:[STOP][:STEP] Slices to extract -a, --animate Output animated image file instead of writing each frame individually -F, --fps INTEGER Frame rate used for animated image files [default: 5] -s, --separate-channels Output the RGB/L and A channels separately -O, --overbright-factor FLOAT Multiplicative factor used for decoding compressed HDR textures [default: 16.0] --compress / --no-compress Control lossless compression --always-write / --no-write Write images --readback / --no-readback Readback images --num-workers INTEGER Number of workers for parallel conversion [x>=1] --no-progress Do not show the progress bar --version Show the version and exit. --credits Show the credits and exit. --help Show this message and exit.

See Also

External Links