"SGReader" for reading textures and "C3Modder" for writing textures
github.com/bvschaik/citybuilding-tools/releases/tag/sgreader-v1.1
yadi . sk/d/OLeXXZOC3SG6w7
*.555 stores pictures and animation frames.
*.sg3 stores ID, offset, length, width, height, type, ..
Dimitrius, 2012
web.archive.org/web/20191206223846/caesar-iii.ru/bibliotheca/mod_gfx.html
Pecunia (bvschaik, Bianca van Schaik) and users discuss how to make SGWriter.
They do not yet know about the existence of C3Modder and are trying to solve problems
caesar3 . heavengames . com/cgi-bin/forums/display.cgi?action=st&fn=1&tn=7451&st=25
@pecunia
..sg2/3 files store a lot more information besides the image data: dimensions, animation offsets, whether the animation can also work in reverse, etc.
@user3
..sgreader doesn't save the full 555 directory structure and doesn't even try to unzip the sg directory structure.
@Pelagius_II
..each .SG file links to one or more .555 files for storing image data, and in the case of "external" links, multiple .SG files can link to the same .555 file. This entails that any modifications to a given .555 file will require overwriting all .SG files that refer to it, and you cannot be sure which .SG files do this until you have parsed all .SG files of them. (The .555 files themselves are just a dumb collection of compressed images—by themselves, they don't have structural metadata to indicate who they belong to.)
@Pelagius_II
..In many cases, a particular piece of image data is only referenced by one .SG file, but due to run-length encoding for transparency, many images with the same width/height will shrink to different sizes, so you can't just replace the old image with the new one and rely that you squeeze it into the same slot. .555 files are like a stack of books, where each "book" is a specific image, sprite, or animation frame. If you want to add/remove/replace a book halfway down, you must also raise or lower all books from the top. And since all .SG files are related to this book in height, that also requires updating their data.
Post edited March 14, 2022 by Telariust