prevnext   » SZS: Wiimms SZS Toolset » wimgt: Wiimms Image Tool

wimgt: Wiimms Image Tool

Wiimms Image Tool : Extract and convert graphic images. The file formats TPL, TEX, BTI, BREFT and PNG are supported.

Contents

1.   Syntax

wimgt [option]... command [option|parameter|@file]...

2.   Features of wimgt

Read »Features« for features of the whole toolset.

3.   Commands

VERSION Print program name and version and exit.
HELP H Print help for commands and options.
ARGTEST This debug command accepts all kinds of parameters and prints one line for each parameter.
TEST This debugging command accepts all options and parameters and prints a list of the internal option values. The command is designed to test the option parameters. The non option parameters are completly ignored.
COLORS Ignore all parameters and print clored text for testing.
ERROR ERR Translate an exit code to a message name. If no exit code is entered, print a table with all error messages.
FILETYPE FT Scan the header of the entered files and print file type and path for each file as list.
FILEATTRIB FA Print a table with attributes for all known file types. If at least one keyword is entered, only matching file types are printed. A keyword is either a file type (like 'BRRES' or 'BMG') or one of the printed keywords (like 'ARCHIVE' or 'EXTRACT').
LIST LS List images files and print file and image type.
LIST-L LL List images files and print file and image type and geometry data. 'LIST-L' is a short cut for »LIST --long«.
LIST-LL LLL List images files and print file and image type and advanced geometry data. 'LIST-LL' is a short cut for »LIST --long --long«.
DECODE DEC Decode (export) the entered image files into PNG files. The default destination is '%P/%F.png'.
ENCODE ENC Encode (import) the entered PNG files and convert them to to an internal image format (TPL, TEX, BREFT). The default destination is '%P/%N' (removed extension).
CONVERT CV Convert the entered image files into new file and image formats. The old file is replaced by the new one. The difference to ENCODE is only the default file name handling.
COPY CP Copy and convert an image from 'source' to 'dest'. Multiple sources can be used, if 'dest' is a directory or contains at least one %-pattern.

This is an alternative for the ENCODE and DECODE commands. The default destination file format is selected by scanning the file extension of the destination. Option --transform may override this.

4.   Options in alphabetic order

Options
Option Param Description
-a --all Convert all files and not only the files with changed file or image formats.
--allow-all Usually commands accept only options with impact to the command. All other options fire a syntax error. But if --allow-all is set, all commands accept all options.

This makes changing the command of a long command line without removing useless options easier. It also helps to override wrong option permissions.

-B --brief Create smaller output.
--chdir dir Set a new working directory for all following options, for all parameters and for the command execution. This option can be used multiple times, but for parameter parsing and for command execution only the last usage is relevant. Nevertheless, '@param' values are scanned while reading the command line.
--color Force colorized text. This is the default, if an output file is a terminal. But colorized text is only supported for a few messages.

If a command is prefixed by 'C-', then this option is set automatically.

--compatible vers The option expects a version number (format '#.##' or 'v#.##') or a revision number (format 'r#') as parameter. If set, the tools try to create BMG and KMP text files, that are compatible to the entered version of the tools. This may override other legacy options.
-c --const list Define constant values, that are used by the internal encoders and by the numeric options as predefined global variables. This option allows a conditional encoding of text files. It can be used multiple times for multiple definitions.

The Parameter is a comma separated list of terms and a term is 'name=expression'. The expression is calculated by the text parser.

--ct-code Enable the CT-CODE modus.
--de Use german track and arena names.
-d --dest path Define a destination path (directory/file). The destination - means: write to standard output.

The path may contain escape sequences: %Q is replaced by the fully qualified source name. %P and %F are replaced by the source path or by the filename. %N and %E are replaced by source filename without extension or by the source extension. Finally, %T is replaced by the default extension of the destination format.

A '?' direct behind '%' in %E and %T conversions avoid that the same extension is used twice in row.

-D --DEST path Like --dest, but create the directory path automatically.
-E --esc char Define an alternative escape character for destination files. The default is '%'. For Windows batch files it is a good choice to set '-E$'.
--force The tools analyse input files and reject files with invalid data structures. If --force is set, little repairable issues are ignored and a warning is printed.

Option »--kmp force« does the same, but only for KMP files.

>>> THE RESULT MAY BE INVALID OUTPUT FILES! <<<

-h --help Stop parsing the command line, print a help message and exit.
-i --ignore Ignore non existing source files without warning.
-l --long Print long numeric message IDs instead of alternative message names like Txx, Uxx or Mxx.
-M --max-file-size size This security option defines the maximum file size for input files; larger files are ignored with a warning. The default unit is MiB and the default size is 100 MiB; that should be enough for standard usage.
--mipmap-size num Define the minimal width and minimal height of a generated mipmap. The default is 16. Tools before v1.49 used 1 as not alterable value. --mm-size is a short cut.
--mipmaps If reading a source, scan for mipmaps and load them too. For PNG files, files named NAME.mm#.EXT with #=1.. are searched. This is the default.
--n-mipmaps num Force the number of mipmaps. Values between 0 and 20 are allowed. Value AUTO (default) enabless automatic detection. The creation of mipmaps stops if the witdh or the height of the mipmap becomes 0. --n-mm is a short cut.
--no-color Deactive colorized text. This is the default, if an output file is not a terminal.
-H --no-header Suppress the syntax information section in BMG text files.
--no-mipmaps If reading a source, ignore mipmaps. This disables not the creation of mipmaps (see -n-mipmaps). --no-mm is a short cut.
--number If a file already exist, append a number directly before the file extension to make the filename unique. If other numbered files already exist (ignoring case), use the maximum existing index+1. --num is a short cut.
-o --overwrite Overwrite already existing files without warning and ignore option --number.
-P --patch mode1.mode2...=file This option specifies patch mode list and a file, separated by an equal sign. Mode is a point separated list of the keywords: TOP (T), BOTTOM (B), VCENTER (V), INS-TOP (IT) and INS-BOTTOM (IB) for the vertical alignment, LEFT (L), RIGHT (R), HCENTER (H), INS-LEFT (IL) and INS-RIGHT (IR) for the horizontal alignment, COPY (CP), BACKGROUND (BG), FOREGROUND (FG) and MIX (MX) as color calculation mode and SHRINK (SH), GROW (GR) and LEAVE (LV) as image size mode.

Abbreviations are allowed. The default is VCENTER.HCENTER.MIX.LEAVE or in short form V.H.MX.LV. If this option is used multiple times all patch files will be used in the entered order.

--pre-convert Convert the image before the image format for the destination file is selected. This results in a perhaps worser graphic and is only useful to control graphic conversions.
-p --preserve Preserve file times (atime+mtime) while converting or copying files.
-q --quiet Be quiet and print only error messages. Multiple usage is possible. The impact is command dependent.
-r --remove-dest Remove already existing files before creating it. If set, --overwrite is ignored. --rm-dest is a short cut.
--sections Print in machine readable sections and parameter lines.
--smart If resizing an image, use the new smart resize function. The new function is much slower (factor 2-4) than the old function, but creates much better resized images. This is only relevant for creating mipmaps with odd width or height.
-t --test Run in test mode, modify nothing.

>>> USE THIS OPTION IF UNSURE! <<<

-x --transform list Convert image formats when reading. A comma separated list with terms is expected. A term have the syntax '[SRC=]DEST'. It means: convert SRC format into DEST format. If SRC= is not set, the destination format is used for all source formats. This makes only sense as last rule. If DEST is empty no transformation is done for the source. Examples: 'TPL' or 'GRAY' or 'BTI.IA8' or 'TPL.I4+I8=IA8,TEX=,CMPR'

SRC and DEST are tupel of file, image and palette formats and of 2 more attributes. All parts are optional and separated by points, the order is irrelevant.

Allowed file formats are: TPL, TEX, BTI, BREFT-IMG (=BTIMG), PNG (import). Allowed image formats are: I4, I8, IA4, IA8, RGB565 (=R565), RGB5A3 (=R3), RGBA32 (=R32), C4, C8, C14X2, CMPR. Allowed palette formats are: P-IA8 (=P8), P-RGB565 (=P565), P-RGB5A3 (=P3). Attributtes are PALETTE, NO-PALETTE, GRAY, COLOR, ALPHA and NO-ALPHA.

All terms are managed as list. For each graphic the list is iterated until the first SRC tupel of a term matches the graphic. Then the destination tupel is used for the transformation.

The command »wimgt TEST« prints a clearly arranged readable table as result of this option.

-u --update Create only files that do not exist. Already existing files are ignored without warning. If set, --overwrite and --remove-dest are ignored.
-v --verbose Be verbose and print more progress information. Multiple usage is possible. The impact is command dependent.
-V --version Stop parsing the command line, print a version info and exit.
--width width Define the width (number of columns) for help and some other messages and disable the automatic detection of the terminal width.
--xhelp Stop parsing the command line and print a help message with all commands included. Exit after printing.