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,-llist tilesets and images in the file, along with an
idthat can be passed to the other commands.--extract-all-images,-Xextract all the images in the file, saving them into the current directory as a separate .png file per image.
--extract-all-tilesets,-Textract 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
--widthoption.--extract=id[=dest.png],-xid[=dest.png]extract
idfrom the tileset, saving it asdest.png(or into the current directory asid.png ifdest.pngis not supplied.)--overwrite=id[=new.png],-oid[=new.png]replace
idwith the data fromnew.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 innew.pngshould match the one generated when extracting images. Ifnew.pngis not specified,is used.id.png--insert-image=id[=new.png],-iid[=new.png]store
new.pngat the positionid, shifting the originalidand all following tiles closer to the end of the file. Ifnew.pngis not specified,is used.id.png--insert-tileset=id,-nidadd an empty tileset at position
id, shifting the originalidand 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,-pidprint image
idto standard output using ANSI codes and spaces to display the image on a text console.--set-size=WxH,-zWxHset all images in the tileset
idtoWpixels wide andHpixels high. This will cause all images to become distorted, so all images will need to be overwritten after this operation.
Options
--type=format,-tformatmanually 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-typesshow a list of supported file formats, along with the value to pass to
--type.--width=num,-wnumwhen using
--extractwith 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--widthof 8 will result in a .png file of 8x4 tiles.--force,-fopen the file as the given
--type, even if it doesn't look like it's in that format.--script,-sprint 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.pngin 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.