No vtf: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Update help to version 4.0.0)
Line 5: Line 5:
== Help text ==
== Help text ==
{{License|type=lgpl|version=3}} Help from no_vtf run without an input file:
{{License|type=lgpl|version=3}} Help from no_vtf run without an input file:
{{codeblock|<!--
{{codeblock|
--><nowiki>Usage: no_vtf [OPTIONS] PATH...
Usage: {{font color|#AF00AF|<b>no_vtf</b>}} <b>[OPTIONS] [--] PATH...</b><br>
 
&nbsp;&nbsp;Convert Valve Texture Format files into standard image files.<br>
  Convert Valve Texture Format files into standard image files.
&nbsp;&nbsp;PATH can be either file, or directory (in which case it is recursively
 
&nbsp;&nbsp;searched for .vtf files, symbolic links are not followed). Multiple paths
  PATH can be either file, or directory (in which case it is recursively
&nbsp;&nbsp;may be provided.<br>
  searched for .vtf files, symbolic links are not followed). Multiple paths
&nbsp;&nbsp;As the output path, it is possible to specify either file or directory.<br>
  may be provided.
&nbsp;&nbsp;Specifying the output file is useful mostly for single-file conversions,
 
&nbsp;&nbsp;with filters to ensure the output file will be written only once.<br>
  As the output path, it is possible to specify either file or directory.
&nbsp;&nbsp;If the output directory is not specified, images are output into the source
 
&nbsp;&nbsp;directories (in-place conversion). Otherwise, directory tree for any found
  Specifying the output file is useful mostly for single-file conversions,
&nbsp;&nbsp;files will be reconstructed in the chosen directory.<br>
  with filters to ensure only a single image will be written.
&nbsp;&nbsp;Output LDR/HDR format is selected by its common file name extension. It is
 
&nbsp;&nbsp;recommended selecting one of the specifically supported image formats (PNG,
  If the output directory is not specified, images are output into the source
&nbsp;&nbsp;APNG, TGA, TIFF, EXR). Other image formats have not been validated to work,
  directories. Otherwise, directory tree for any found files will be
&nbsp;&nbsp;but can be still selected. A secondary format specifically used to output
  reconstructed in the chosen directory.
&nbsp;&nbsp;animated image files can be selected after &apos;&#124;&apos; (see default LDR format as an
 
&nbsp;&nbsp;example). The &quot;skip&quot; format can be used to skip the write step entirely.<br>
  Output LDR/HDR format is selected by its common file name extension. Special
&nbsp;&nbsp;For the specifically supported image formats, compression is configurable
  formats: "raw" to write the high resolution image data as-is; "skip" to skip
&nbsp;&nbsp;when saving the image. Lossless compression is enabled by default. Lossy
  the write step entirely.
&nbsp;&nbsp;compression is not used.<br>
 
&nbsp;&nbsp;The BGRA8888 format can store both LDR and compressed HDR images. The
  For supported formats, compression is controlled when saving the image.
&nbsp;&nbsp;specific type is either auto-detected by looking at the input file name
  Lossless compression is enabled by default. Lossy compression is not used.
&nbsp;&nbsp;(roughly, if it contains &quot;hdr&quot; near the end), or can be set manually.<br>
 
&nbsp;&nbsp;It is possible to filter images to convert by min/max resolution (width &amp;
  The BGRA8888 format can store both LDR and compressed HDR images. The
&nbsp;&nbsp;height), and by frames/faces/slices. The former supports exact or closest
  specific type is either auto-detected by looking at the input file name
&nbsp;&nbsp;match. The latter supports selection by single index or via Python slicing:
  (roughly, if it contains "hdr" near the end), or can be set manually.
&nbsp;&nbsp;https://python-reference.readthedocs.io/en/latest/docs/brackets/slicing.html<br>
 
&nbsp;&nbsp;Face index mapping: right (0), left, back, front, up, down, sphere map (6).<br>
  It is possible to filter images to convert by min/max resolution (width &
&nbsp;&nbsp;After applying filters, only the highest-resolution mipmap is converted by
  height), and by frames/faces/slices. The former supports exact or closest
&nbsp;&nbsp;default. Alternatively, all mipmaps of the high-resolution image can be
  match. The latter supports selection by single index or via Python slicing:
&nbsp;&nbsp;converted.<br>
  https://python-reference.readthedocs.io/en/latest/docs/brackets/slicing.html
&nbsp;&nbsp;Animated textures are converted into an animated multi-frame image file by
 
&nbsp;&nbsp;default. Alternatively, they can also be converted into single-frame images
  Face index mapping: right (0), left, back, front, up, down, sphere map (6).
&nbsp;&nbsp;with animation disabled.<br>
 
&nbsp;&nbsp;The RGB/L and A channels are packed into one file by default. When output
  After applying filters, only the highest-resolution mipmap is converted by
&nbsp;&nbsp;separately, resulting file names will be suffixed with &quot;_rgb&quot;, &quot;_l&quot; or &quot;_a&quot;.<br>
  default. Alternatively, all mipmaps of the high-resolution image can be
&nbsp;&nbsp;By default, image files are only written if they do not exist already.
  converted.
&nbsp;&nbsp;Alternatively, they can be overwritten, or writing can be disabled entirely.<br>
 
&nbsp;&nbsp;Images can also be read back to verify they have been written properly.
  Animated textures have frames converted into individual images by default.
&nbsp;&nbsp;Readback will error if data to be written do not match what is in the file.<br>
  They can also be converted into an animated image file. When the latter is
&nbsp;&nbsp;Worker is spawned for each logical core to run the conversion in parallel.
  chosen, APNG is used as the default LDR image format instead of TIFF.
&nbsp;&nbsp;Number of workers can be overridden. If set to 1, conversion is sequential.<br>
 
&nbsp;&nbsp;Exit status: Zero if all went successfully, non-zero if there was an error.
  The RGB/L and A channels are packed into one file by default. When output
&nbsp;&nbsp;Upon a recoverable error, conversion will proceed with the next file.<br>
  separately, resulting file names will be suffixed with "_rgb", "_l" or "_a".
<u>Options</u>:
 
&nbsp;&nbsp;{{font color|#D78700|<b>Conversion mode: </b>}}
  By default, image files are only written if they do not exist already.
&nbsp;&nbsp;&nbsp;&nbsp;--animate / --no-animate      Output animated image file (default) /
  Alternatively, they can be overwritten, or writing can be disabled entirely.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output each frame individually
 
&nbsp;&nbsp;&nbsp;&nbsp;--raw                        Extract image data as-is (without decoding)<br>
  Images can be also read back to verify they have been written properly.
{{font color|#D78700|<b>  Extraction: </b>}}
  Readback will error if data to be written do not match what is in the file.
&nbsp;&nbsp;&nbsp;&nbsp;-m, --mipmaps                Extract all mipmaps
 
&nbsp;&nbsp;&nbsp;&nbsp;--low-res-img                Extract low resolution image
  Worker is spawned for each logical core to run the conversion in parallel.
&nbsp;&nbsp;&nbsp;&nbsp;--min-resolution INTEGER      Minimum mipmap resolution  {{font color|gray|&#91;x&gt;&#61;1&#93;}}
  Number of workers can be overridden. If set to 1, conversion is sequential.
&nbsp;&nbsp;&nbsp;&nbsp;--max-resolution INTEGER      Maximum mipmap resolution  {{font color|gray|&#91;x&gt;&#61;1&#93;}}
 
&nbsp;&nbsp;&nbsp;&nbsp;--closest-resolution          Fallback to the closest resolution if no
  Exit status: Zero if all went successfully, non-zero if there was an error.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exact match
  Upon a recoverable error, conversion will proceed with the next file.
&nbsp;&nbsp;&nbsp;&nbsp;--frames INDEX&#124;&#91;START&#93;:&#91;STOP&#93;&#91;:STEP&#93;
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frames to extract
Options:
&nbsp;&nbsp;&nbsp;&nbsp;--faces INDEX&#124;&#91;START&#93;:&#91;STOP&#93;&#91;:STEP&#93;
  -o, --output-dir DIRECTORY      Output directory
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Faces to extract
  --output-file FILE              Output file
&nbsp;&nbsp;&nbsp;&nbsp;--slices INDEX&#124;&#91;START&#93;:&#91;STOP&#93;&#91;:STEP&#93;
  -l, --ldr-format TEXT          LDR output format  [default: tiff|apng]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Slices to extract<br>
  -h, --hdr-format TEXT          HDR output format  [default: exr]
{{font color|#D78700|<b>  Image decoding (not used with --raw): </b>}}
  -d, --dynamic-range [ldr|hdr]  Override LDR/HDR auto-detection
&nbsp;&nbsp;&nbsp;&nbsp;--dynamic-range &#91;ldr&#124;hdr&#93;    Override LDR/HDR auto-detection
  -m, --mipmaps                  Extract all mipmaps
&nbsp;&nbsp;&nbsp;&nbsp;--overbright-factor FLOAT    Multiplicative factor used for decoding
  --min-resolution INTEGER        Minimum mipmap resolution  [x>=1]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compressed HDR textures  &#91;default: 16.0&#93;<br>
  --max-resolution INTEGER        Maximum mipmap resolution  [x>=1]
{{font color|#D78700|<b>  Image postprocessing (not used with --raw): </b>}}
  --closest-resolution            Fallback to closest resolution if no exact
&nbsp;&nbsp;&nbsp;&nbsp;--hdr-to-ldr                  Convert HDR from linear sRGB to sRGB and
                                  match
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output as clipped LDR
  --frames INDEX|[START]:[STOP][:STEP]
&nbsp;&nbsp;&nbsp;&nbsp;--separate-channels          Output the RGB/L and A channels separately<br>
                                  Frames to extract
{{font color|#D78700|<b>  Image output (not used with --raw): </b>}}
  --faces INDEX|[START]:[STOP][:STEP]
&nbsp;&nbsp;&nbsp;&nbsp;-f, --ldr-format SINGLE&#91;&#124;MULTI&#93;
                                  Faces to extract
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LDR output format  &#91;default: tiff&#124;apng&#93;
  --slices INDEX|[START]:[STOP][:STEP]
&nbsp;&nbsp;&nbsp;&nbsp;-F, --hdr-format SINGLE&#91;&#124;MULTI&#93;
                                  Slices to extract
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HDR output format  &#91;default: exr&#93;
  -a, --animate                  Output animated image file instead of
&nbsp;&nbsp;&nbsp;&nbsp;--fps INTEGER                Frame rate used for animated image files
                                  writing each frame individually
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#91;default: 5&#93;
  -F, --fps INTEGER              Frame rate used for animated image files
&nbsp;&nbsp;&nbsp;&nbsp;--compress / --no-compress    Control lossless compression<br>
                                  [default: 5]
{{font color|#D78700|<b>  Read/write control: </b>}}
  -s, --separate-channels        Output the RGB/L and A channels separately
&nbsp;&nbsp;&nbsp;&nbsp;--always-write / --no-write  Write images
  -O, --overbright-factor FLOAT  Multiplicative factor used for decoding
&nbsp;&nbsp;&nbsp;&nbsp;--readback / --no-readback    Readback images<br>
                                  compressed HDR textures  [default: 16.0]
{{font color|#D78700|<b>  Output destination: </b>}}
  --compress / --no-compress      Control lossless compression
&nbsp;&nbsp;&nbsp;&nbsp;-o, --output-dir PATH        Output directory
  --always-write / --no-write    Write images
&nbsp;&nbsp;&nbsp;&nbsp;-O, --output-file PATH        Output file<br>
  --readback / --no-readback      Readback images
{{font color|#D78700|<b>  Miscellaneous: </b>}}
  --num-workers INTEGER          Number of workers for parallel conversion
&nbsp;&nbsp;&nbsp;&nbsp;--num-workers INTEGER        Number of workers for parallel conversion
                                  [x>=1]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{font color|gray|&#91;x&gt;&#61;1&#93;}}
  --no-progress                  Do not show the progress bar
&nbsp;&nbsp;&nbsp;&nbsp;--no-progress                Do not show the progress bar<br>
  --version                      Show the version and exit.
{{font color|#D78700|<b>  Info: </b>}}
  --credits                      Show the credits and exit.
&nbsp;&nbsp;&nbsp;&nbsp;-h, --help                    Show this message and exit.
  --help                          Show this message and exit.
&nbsp;&nbsp;&nbsp;&nbsp;--version                    Show the version and exit.
</nowiki>}}
&nbsp;&nbsp;&nbsp;&nbsp;--credits                    Show the credits and exit.
&#8203;
}}


== See Also ==
== See Also ==

Revision as of 05:27, 5 September 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

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 the output file will be written only once.
  If the output directory is not specified, images are output into the source   directories (in-place conversion). 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. It is   recommended selecting one of the specifically supported image formats (PNG,   APNG, TGA, TIFF, EXR). Other image formats have not been validated to work,   but can be still selected. A secondary format specifically used to output   animated image files can be selected after '|' (see default LDR format as an   example). The "skip" format can be used to skip the write step entirely.
  For the specifically supported image formats, compression is configurable   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 are converted into an animated multi-frame image file by   default. Alternatively, they can also be converted into single-frame images   with animation disabled.
  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 also be 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:   Conversion mode:     --animate / --no-animate Output animated image file (default) /                                   output each frame individually     --raw Extract image data as-is (without decoding)
Extraction:     -m, --mipmaps Extract all mipmaps     --low-res-img Extract low resolution image     --min-resolution INTEGER Minimum mipmap resolution [x>=1]     --max-resolution INTEGER Maximum mipmap resolution [x>=1]     --closest-resolution Fallback to the 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
Image decoding (not used with --raw):     --dynamic-range [ldr|hdr] Override LDR/HDR auto-detection     --overbright-factor FLOAT Multiplicative factor used for decoding                                   compressed HDR textures [default: 16.0]
Image postprocessing (not used with --raw):     --hdr-to-ldr Convert HDR from linear sRGB to sRGB and                                   output as clipped LDR     --separate-channels Output the RGB/L and A channels separately
Image output (not used with --raw):     -f, --ldr-format SINGLE[|MULTI]                                   LDR output format [default: tiff|apng]     -F, --hdr-format SINGLE[|MULTI]                                   HDR output format [default: exr]     --fps INTEGER Frame rate used for animated image files                                   [default: 5]     --compress / --no-compress Control lossless compression
Read/write control:     --always-write / --no-write Write images     --readback / --no-readback Readback images
Output destination:     -o, --output-dir PATH Output directory     -O, --output-file PATH Output file
Miscellaneous:     --num-workers INTEGER Number of workers for parallel conversion                                   [x>=1]     --no-progress Do not show the progress bar
Info:     -h, --help Show this message and exit.     --version Show the version and exit.     --credits Show the credits and exit.

See Also

External Links