Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Difference between revisions of "FTEQW Image Tool Documentation"

From Quake Wiki

m (Example Usage)
 
Line 103: Line 103:
  
 
compress:
 
compress:
imgtool64 --astc_6x6_ldr [--nomips] --ext ktx in.png [in2.png ...]
+
imgtool64 --astc_6x6_ldr --nomips --ext ktx in.png in2.png ...
  
 
compress:
 
compress:
imgtool64 --bc3 [--premul] [--nomips] in.png
+
imgtool64 --bc3 --premul --nomips in.png
 
Convert pixel format (to bc3 aka dxt5) before writing to output file.
 
Convert pixel format (to bc3 aka dxt5) before writing to output file.
 
 
Line 114: Line 114:
  
 
merge:
 
merge:
imgtool64 -o output [--cube|--3d|--2darray|--cubearray] [--bc1] foo_*.png
+
imgtool64 -o output --cube|--3d|--2darray|--cubearray --bc1 foo_*.png
 
Convert to different file format, while trying to preserve pixel formats.
 
Convert to different file format, while trying to preserve pixel formats.
  
Line 122: Line 122:
  
 
decompress:
 
decompress:
imgtool64 --decompress [--exportmip 0] [--nomips] in.ktx out.png
+
imgtool64 --decompress --exportmip 0 --nomips in.ktx out.png
 
Decompresses any block-compressed pixel data.
 
Decompresses any block-compressed pixel data.
  
 
create mips:
 
create mips:
imgtool64 --ext mip [--bc1] [--resize width height] [--exportmip 2] *.dds
+
imgtool64 --ext mip --bc1 --resize width height --exportmip 2 *.dds
  
 
create xwad:
 
create xwad:
imgtool64 --genwadx [--exportmip 2] [--bc1] out.wad srcdir
+
imgtool64 --genwadx --exportmip 2 --bc1 out.wad srcdir
  
 
create wad:
 
create wad:
imgtool64 -w [--exportmip 2] out.wad *.mipsrcdir
+
imgtool64 -w --exportmip 2 out.wad *.mipsrcdir
  
 
extract wad:
 
extract wad:
imgtool64 -x [--ext png] src.wad
+
imgtool64 -x --ext png src.wad
  
 
extract bsp:
 
extract bsp:
imgtool64 -x [--ext png] src.bsp
+
imgtool64 -x --ext png src.bsp
 
</pre>
 
</pre>

Latest revision as of 03:59, 14 July 2021

FTE Image Tool[edit]

This tool can show info about image files, and convert them into different formats. It can extract textures from bsp and wad files, and create wads, xwads, and mips. It's also used for making cubemaps.

Supported Image File Formats[edit]

  • dds
  • ktx
  • tga
  • png (1.6.37)
  • bmp + ico
  • jpeg (90, 9 series)
  • pfm + pbm + pgm + ppm
  • psd
  • hdr
  • astc
  • pkm
  • exr (unavailable)
  • pcx
  • lmp


Supported compressed/interesting pixelformats[edit]

 --L8                   8-bpp
 --L8A8                16-bpp
 --RG8                 16-bpp
 --RGBA16_SF           64-bpp
 --RGBA32_SF          128-bpp
 --A2BGR10             32-bpp
 --B10G11R11_UF        32-bpp
 --RGB565              16-bpp
 --RGBA4444            16-bpp
 --ARGB4444            16-bpp
 --RGBA5551            16-bpp
 --ARGB1555            16-bpp
 --E5BGR9_UF           32-bpp
 --BC1_RGB              4-bpp (requires nvcompress)
 --BC1_RGBA             4-bpp (requires nvcompress)
 --BC2_RGBA             8-bpp (requires nvcompress)
 --BC3_RGBA             8-bpp (requires nvcompress)
 --BC4_R                4-bpp (requires nvcompress)
 --BC5_RG               8-bpp (requires nvcompress)
 --BC6_RGB_UF           8-bpp (requires nvcompress 2.1+)
 --BC6_RGB_SF           8-bpp (requires nvcompress 2.1+)
 --BC7_RGBA             8-bpp (requires nvcompress 2.1+)
 --ASTC_4X4_LDR         8-bpp (requires astcenc)
 --ASTC_5X4_LDR       6.4-bpp (requires astcenc)
 --ASTC_5X5_LDR      5.12-bpp (requires astcenc)
 --ASTC_6X5_LDR      4.27-bpp (requires astcenc)
 --ASTC_6X6_LDR      3.56-bpp (requires astcenc)
 --ASTC_8X5_LDR       3.2-bpp (requires astcenc)
 --ASTC_8X6_LDR      2.67-bpp (requires astcenc)
 --ASTC_10X5_LDR     2.56-bpp (requires astcenc)
 --ASTC_10X6_LDR     2.13-bpp (requires astcenc)
 --ASTC_8X8_LDR         2-bpp (requires astcenc)
 --ASTC_10X8_LDR      1.6-bpp (requires astcenc)
 --ASTC_10X10_LDR    1.28-bpp (requires astcenc)
 --ASTC_12X10_LDR    1.07-bpp (requires astcenc)
 --ASTC_12X12_LDR   0.889-bpp (requires astcenc)


Options[edit]

There are many command-line switches, but these are the most common:

Option Description
-i show info
-x extract
--ext file extension, is useful with wildcards and recursion
-o output
--convert convert
--nomips don't create mip-maps
--premul premultiply the alpha channel into the rgb channels


Example Usage[edit]

show info:
imgtool64 -i *.ktx

compress:
imgtool64 --astc_6x6_ldr --nomips --ext ktx in.png in2.png ...

compress:
imgtool64 --bc3 --premul --nomips in.png
	Convert pixel format (to bc3 aka dxt5) before writing to output file.
	
convert:
imgtool64 --convert in.exr
	Convert to different file format, while trying to preserve pixel formats.

merge:
imgtool64 -o output --cube|--3d|--2darray|--cubearray --bc1 foo_*.png
	Convert to different file format, while trying to preserve pixel formats.

recursive:
imgtool64 --auto --astc_6x6_ldr destdir srcdir
	Compresses the files to dds (writing to an optionally different directory)

decompress:
imgtool64 --decompress --exportmip 0 --nomips in.ktx out.png
	Decompresses any block-compressed pixel data.

create mips:
imgtool64 --ext mip --bc1 --resize width height --exportmip 2 *.dds

create xwad:
imgtool64 --genwadx --exportmip 2 --bc1 out.wad srcdir

create wad:
imgtool64 -w --exportmip 2 out.wad *.mipsrcdir

extract wad:
imgtool64 -x --ext png src.wad

extract bsp:
imgtool64 -x --ext png src.bsp