PVRTexTool Command Line Options
Option | Description | Usage | Example |
---|---|---|---|
Help | Provides a list of all available CLI options. Help can also be used to output additional information about a specific option. |
|
|
Input file | [REQUIRED] Sets the input file or files. Must be a JPEG, PNG,BMP, TGA, HDR, GIF, PSD, PPM, PGM, PIC, PVR, KTX, KTX2, DDS, ASTC file, or BASIS container file. If either the cube map or texture array flag is set, multiple files should be explicitly specified. | -i [filepath],<otherfiles...> | -i image.jpg, image2.png |
Input colour space | Explicitly set the colour space for all input files. Valid colour spaces:
| -ics [colourspace] | -ics lRGB |
No Output | Suppress the output of a .pvr file | -noout | -noout |
Output file | Sets the output file destination. If specified, must be a PVR, KTX, KTX2, H, or DDS file. Otherwise the application outputs a file with the same name as the first input file. | -o <filepath> | -o texture.pvr |
Decompress output | If set, saves a decompressed file alongside the input. A file name can be specified as JPEG, PNG, BMP, TGA or HDR. If the file name is unspecified, the file is decompressed to a file with the same name as the first input file (the default decompressed file type is PNG). For cube maps and texture arrays, the behaviour is different. A series of decompressed files is output in the following format:
For example: | -d <filepath> | -d decompressed.png |
Cube map | Constructs a cube map from available input files. The input file argument must contain at least six textures or a multiple of six textures if the array flag is present. Textures of different sizes are resized with a linear filter to the size of the original texture, or the specified size if resizing. | -cube <faceorder> | -cube +X,-X,+Y,-Y,+Z,-Z |
Equi to Cube map | Constructs a cube map from a single equirectangular image, the input file must have an aspect ratio of 2:1. By default this operation uses a linear filter; optionally supply 'nearest', 'linear' or 'cubic' to override. | -equi2cube <filter> | -equi2cube cubic |
Texture array | Constructs a texture array from available input files. The input file argument should contain multiple files or a multiple of six textures if the cube map flag is enabled. | -array | -array |
Resize | Resizes a texture to the given size represented by two unsigned integer parameters for width and height. Values up to 8096x8096 are supported. This option is incompatible with square or power of two resize options. | -r [width],[height] | -r 512,256 |
Resize square | Forces the texture into a square. A single character parameter, - or +, can be specified to indicate if it should be resized smaller or larger. Incompatible with standard resize. | -square <+|-> | -square + |
Resize power of two | Forces the texture into power of two dimensions. A single character parameter, - or +, can be specified to indicate if it should be resized smaller or larger. Incompatible with standard resize. | -pot <+|-> | -pot + |
Resize filter | By default, a linear filter is used to resize textures. Setting this flag to nearest, linear or cubic forces PVRTexTool to use the specified filter to resize textures. | -rfilter [nearest|linear|cubic] | -rfilter cubic |
Rotate | Rotate the texture around a given axis x, y or z. Currently only z is supported; this is a standard 2D rotate. Also requires a second argument - or + to choose the rotate direction. In the context of a 2D rotation + is clockwise and - is anti-clockwise. | -rotate [z],<+|-> | -rotate z,+ |
Flip | Flips the texture over a given axis x, y, or z. Currently only x and y are supported providing a standard 2D flip. Also accepts an optional second argument (flag) that adds metadata to the texture marking it as being flipped. This is useful when knowledge of the orientation is required ahead of time, for example, if displaying a flipped texture in its original orientation. | -flip [x|y],<"flag"> | -flip y,flag |
Add border | Adds a mirrored border to the texture. If no arguments are specified, PVRTexTool chooses an appropriate border size for the texture. Alternatively, border sizes can be chosen manually for the width and height. Specifying only the width is allowed, and results in the vertical border having a height of zero. | -b <width>,<height> | -b 4,4 |
Pre-multiply alpha | Pre-multiplies the texture by its alpha value. | -p | -p |
Alpha bleed | Discards any data in fully transparent areas to optimise the texture for better compression. | -l | -l |
Normal map generation | Uses the input texture as a height map to generate a normal map by creating an intensity texture from the r, g and b channels. Accepts two arguments: a positive float which determines the scale that the height map is assumed to be on, and a string of a combination of the four characters x, y, z and h. These specify the channel order as saved out into the texture. x, y and z specify these components, and h specifies the original height value used. Duplicate channels are not allowed, but channels can be missed off. This argument is optional, and the default is xyz. | -n [scale],<channelorder> | -n 1.0,xyzh |
Mipmap generation | Generates MIP maps for the current texture. An optional unsigned integer can be added to specify the number of MIP map levels which should be generated, otherwise a full chain is created. | -m <numberofmipmaps> | -m 9 |
MIP map filter | Specifies the filter used to generate MIP maps: nearest, linear, or cubic. If not specified, a linear filter is used. | -mfilter [nearest|linear|cubic] | -mfilter cubic |
Colour MIP maps | Saturates the tail of the MIP map chain with colours for debugging purposes. If the original colour of a texture cannot be seen, then it is assumed to be using MIP maps at all times, and some upper levels can be removed from the texture to reduce memory consumption. | -c | -c |
Encode format | Sets the encoding format. The first argument is the format, which is required. This can be either a compressed format or a non-compressed format in the form The third argument specifies the colour space, which accepts either sRGB or lRGB. The default is lRGB for linear RGB. If an encoding format is not specified then the texture format of the first input will be used. Valid compressed formats:
Valid variable types:
Key:
Valid colour spaces:
| -f [format],<vartype>,colourspace> | -f PVRTC1_2,UBN,lRGB |
Encode quality | Sets the level of compression quality used for PVRTC, ETC, ASTC and BASISU formats.Valid quality modes:
| -q [compressorquality] | -q pvrtcfast |
Dither | If set, tells the compressor to dither the texture before compression to avoid banding artefacts. | -dither | -dither |
Max Range | Sets the maximum range (min 1.0) to use when encoding to RGBM and RGBD texture formats. A higher value will allow for a higher dynamic range at the expense of accuracy which may lead to artefacts such as banding. This value will also be inserted into the PVR meta data. | -maxrange [value] | -maxrange 8.0 |
Diffuse Irradiance | Generate a Mip mapped diffuse irradiance texture from a cube-map environment texture, to be used primarily with physically based rendering (PBR) techniques. First (required) argument is the number of samples to use when generating the environment map. Second (required) argument is the output dimensions, in pixels. The default channel type for this texture is 32 bit floating point. | -ibldiffuse [samples],[dimensions] | -ibldiffuse 200,64 |
Pre-filtered Specular | Generates a Mip mapped pre-filtered specular irradiance texture from a cube-map environment texture, to be used primarily with physically based rendering (PBR) techniques. Each Mip level of the specular map is blurred by a roughness value between 0 and 1. First (required) argument is the number of samples to use when generating the environment map. Second (required) argument is the output dimensions, in pixels. Third (optional) argument is the number of Mip levels to be discarded from the bottom of the Mip chain. The default channel type for this texture is 32 bit floating point. | -iblspecular [samples],[dimensions],<levels to discard> | -iblspecular 400,512,2 |
Include Roughness Zero | Include a roughness of zero when generating the pre-filtered specular environment map. By default roughness zero will not be included in the pre-filtered specular texture; in this case the user should supply roughness zero from the source environment texture. | -irz | -irz |
Red/Green/Blue/Alpha channel | Sets the red channel in the input texture to match the channel specified in a second image. A file name is specified for the source, and an optional channel name (single character) can be specified to select the source. By default, the channel draws from its equivalent in the new texture. For example, red draws from red, green from green, and so on. Valid source channels are r, g, b, a, l, i. These represent red, green, blue, alpha, luminance and intensity. | -[channeltype] [filename],<channelname> |
|
Difference | Calculates the difference between the input and a supplied file, providing error metrics, and is incompatible with performing compression (-f ). A visual representation of the differences can be output by selecting an output mode: - Colour - outputs the absolute delta of each channel into a texture. The modifier multiplies the deltas to highlight any issues (default: 1.0).
| -diff [filename],<mode>,<modifier> | -diff Other.png,Blend,0.5f |
Resize canvas | Resizes a texture to the given size, without changing the image data. This takes effect after resizing. Accepts two unsigned integer parameters for width and height. Values up to 8192x8192 are supported. Option is incompatible with square or power of two canvas resize options. | -rcanvas [width],[height] | -rcanvas 512,256 |
Resize canvas square | Forces the texture into a square, without changing the image data. This takes effect after resizing. A single character parameter, - or +, can be specified to indicate whether to resize smaller (-) or larger (+). Incompatible with standard resize. | -squarecanvas <+|-> | -squarecanvas + |
Resize canvas power of two | Forces the texture into power of two dimensions, without changing the image data. This takes effect after resizing. A single character parameter, - or +, can be specified to indicate whether to resize smaller (-) or larger (+). Incompatible with standard resize. | -potcanvas <+|-> | -potcanvas + |
Offset canvas | Sets the offset when performing a canvas resize, including square or pot resizes. Accepts two signed integer parameters for xoffset and yoffset. Values between -8192 x -8192 and 8192 x 8192 are supported. Incompatible with centre canvas. | -offsetcanvas [xoffset],[yoffset] | -offsetcanvas -12,56 |
Centre canvas | Sets the offset when performing a canvas resize (including square or power of two resizes) so that the image resides in the centre of the canvas. Incompatible with canvas offset. | -centrecanvas | -centrecanvas |
Number of Jobs | Sets the maximum number of threads to use for transcoding. All available cores are used by default | -j | -j 8 |