gametls

Name

gametls — manipulate collections of images (tilesets) used internally by many games

Synopsis

gametls [options...] tileset [actions...]

Description

Perform the specified actions on the given tileset file. The actions are performed in order (i.e. the first action specified on the command line is performed first.)

Actions

--list, -l

list tilesets and images in the file, along with an id that can be passed to the other commands.

--extract-all-images, -X

extract all the images in the file, saving them into the current directory as a separate .png file per image.

--extract-all-tilesets, -T

extract all the images in the file, combining them into one .png file per tileset (e.g. as a grid of 10x10 tiles.) Grid size is controlled via the --width option.

--extract=id[=dest.png], -x id[=dest.png]

extract id from the tileset, saving it as dest.png (or into the current directory as id.png if dest.png is not supplied.)

--overwrite=id[=new.png], -o id[=new.png]

replace id with the data from new.png. The image must be in the correct format (bit depth) or an error will be returned. The palette in the image file (if any) is not changed, so for best results the palette in new.png should match the one generated when extracting images. If new.png is not specified, id.png is used.

--insert-image=id[=new.png], -i id[=new.png]

store new.png at the position id, shifting the original id and all following tiles closer to the end of the file. If new.png is not specified, id.png is used.

--insert-tileset=id, -n id

add an empty tileset at position id, shifting the original id and all following sub-tilesets closer to the end of the file. This can only be used with file formats that support sub-tilesets.

--print=id, -p id

print image id to standard output using ANSI codes and spaces to display the image on a text console.

--set-size=WxH, -z WxH

set all images in the tileset id to W pixels wide and H pixels high. This will cause all images to become distorted, so all images will need to be overwritten after this operation.

Options

--type=format, -t format

manually specify the file type. The type is normally autodetected, but it needs to be specified for a few formats which lack signatures to identify them by. See --list-types.

--list-types

show a list of supported file formats, along with the value to pass to --type.

--width=num, -w num

when using --extract with a tileset or --extract-all-tilesets, this option controls the width of the .png image, measured in tiles. A tileset with 32 images and a --width of 8 will result in a .png file of 8x4 tiles.

--force, -f

open the file as the given --type, even if it doesn't look like it's in that format.

--script, -s

print output suitable for parsing by a script.

Examples

gametls cc1.gfx --list

display a list of the images inside the main Crystal Caves graphics file.

gametls cc1.gfx --extract-all-images

extract every image in every tileset as a separate .png file into the current directory.

gametls cc1.gfx --extract-all-tilesets

extract all the tilesets into a handful of .png files in the current directory (all the images in each tileset are displayed as a grid in each .png file.)

gametls cc1.gfx -p 0.1.2

print the third image ("2") from the second tileset ("0.1") as ANSI coloured text.

gametls cc1.gfx -x 0.1.2=test.png

extract the third image ("2") from the second tileset ("0.1") and save it as test.png in the current directory.

gametls cc1.gfx -o 0.1.2=new.png

overwrite the image extracted in the previous example with the contents of new.png.

gametls cc1.gfx --type=img-ccaves --list

list contents of the tileset, when the format can't be autodetected and must be specified manually with --type.

Notes

Exit status is 0 on success, non-zero on failure (1 for bad parameters, 2 for critical errors such as being unable to open the the archive file, 3 for more information needed, 4 for non-critical errors such as being unable to insert one of many files, 5 for uncommon failures like running out of disk space.)

All the file formats supported by this utility are fully documented on the Game Modding Wiki.

Bugs and Questions

Report bugs at https://github.com/Malvineous/libgamegraphics/issues

Ask questions about Camoto or modding in general at the RGB Classic Games modding forum

Copyright

Copyright (c) 2010-2017 Adam Nielsen.

License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.