Maketx is a command-line utility to convert images to tiled, MIP-mapped textures, similar to txmake in Pixar Renderman. It is part of OpenImageIO (http://www.openimageio.org) and was developed by Larry Gritz at Sony Pictures Imageworks.
The first benefit is that you are assured of having mipmaps and tiles. These will dramatically improve time to the first pixel, overall render time, and allow using a smaller texture cache. This should be considered mandatory, with the possible exception being don't use .tx for the few images you are actively modifying if you don't want to wait for them to be constantly converted to .tx every time you make a change.
The previous level you could get from non-tx files that you saved with tiles and mipmapping. The second level of benefit is only with .tx files and that involves maketx adding metadata that lets Arnold make more optimizations, such as being able to detect duplicate textures and only loading a single copy into memory or detecting constant color images, such as an all-black UDIM, and instead of storing all those black pixels in memory Arnold can special case that.
An example of mipmap image storage. The first image on the left is shown with filtered copies reduced in size.
The maketx command with verbosity, converting from a tif to a tx
maketx [options] file...
maketx -v -u --oiio --checknan --filter lanczos3 path/to/fileIn.tif -o path/to/fileOut.tx
When pre-processing your texture files with maketx make sure you add the --oiio flag which will generate TX files optimized for Arnold that can render even faster by forcing the tile size to be optimal for OpenImageIO (64x64). It also stores channels interleaved (RGBARGBA...) making them faster to read and enables constant color detection: if the image is a constant color it will convert it to a tiny single color .tx file. Additional metadata and an image hash (fingerprint) are embedded by default. The fingerprint lets OIIO detect duplicate images (not tiles) when opening new files. Generally using maketx will result in better texture I/O performance than using txmake.
Note also that if you need your textures to stay compatible with Renderman, there is a --prman switch that will ensure the tile size matches what Renderman expects.
If the output color space is not the same bit depth as input color space, then the data format needs to be set to the proper bit depth using the -d option.
The best workflow is to always generate .tx files using maketx as the last step before rendering and use those .tx files just for rendering. This will ensure the best performance. Also, ensure that your textures are in linear color space before converting them with maketx. No information is lost when converting High Dynamic Range images to the .tx format.
|Print help message|
|Verbose status messages|
|Number of threads (default: #cores)|
|Specify output file format (default: guess from extension)|
|Specify the number of output image channels.|
|Set the output data format to one of: uint8, sint8, uint16, sint16, half, float|
|Specify tile size|
|Use planarconfig separate (default: contiguous)|
|Field of view for envcube/shadcube/twofish|
|Override the frame aspect ratio. Default is width/height.|
|Specify wrap mode (black, clamp, periodic, mirror)|
|Specifiy s wrap mode separately|
|Specifiy t wrap mode separately|
|Resize textures to power of 2 (default: no)|
|Do not resize textures to power of 2 (deprecated)|
|Select filter for resizing (choices: box triangle gaussian catrom blackman-harris sinc lanczos3 radial-lanczos3 mitchell bspline, disk, default=box)|
Do not make multiple MIP-map levels
|Check for NaN/Inf values (abort if found).|
|Set the camera matrix|
|Set the camera matrix|
|Embed SHA-1 hash of pixels in the header (deprecated. hashes are always computed).|
|Add prman specific metadata|
|Create 1-tile textures from constant color inputs|
|Create 1-channel textures from monochrome inputs|
|Drop alpha channel that is always 1.0|
|Print runtime statistics|
|Specify an individual MIP level|
|Basic modes (default is plain texture)|
|Create shadow map|
|Create lat/long environment map|
|Create cubic env map (file order: px, nx, py, ny, pz, nz) (UNIMP)|
|Color Management Options|
--colorconvert %s %s
|Apply a color space conversion to the image. If the output color space is not the same bit depth as input color space, it is your responsibility to set the data format to the proper bit depth using the -d option. (choices: linear, sRGB, Rec709)|
|Unpremultiply before color conversion, then premultiply after the color conversion. You'll probably want to use this flag if your image contains an alpha channel.|
|Use OIIO-optimized settings for tile size, planarconfig, metadata, and constant-color optimizations.|
|Use PRMan-safe settings for tile size, planarconfig, and metadata.|
Do not linearize textures used to drive scalar values as you will lose precision values.
Maketx supports the following file formats: