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

wimgt convert

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.

Contents

1.   Syntax

wimgt CONVERT [source]...

2.   Options

Options
Option Param Description
-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$'.
-o --overwrite Overwrite already existing files without warning and ignore option --number.
--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.
-r --remove-dest Remove already existing files before creating it. If set, --overwrite is ignored. --rm-dest is a short cut.
-u --update Create only files that do not exist. Already existing files are ignored without warning. If set, --overwrite and --remove-dest are ignored.
-p --preserve Preserve file times (atime+mtime) while converting or copying files.
-i --ignore Ignore non existing source files without warning.
-a --all If source and destination file are the same, the file is only written on modifications (transform, patch, ...). If --all is set, then the file is always written.
--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.
--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.
--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 --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.

--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.
--no-mipmaps If reading a source, ignore mipmaps. This disables not the creation of mipmaps (see -n-mipmaps). --no-mm is a short cut.
--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.
-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.