Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab  » sticom - comprehensive command line tool for processing STI files
sticom - comprehensive command line tool for processing STI files[message #277580] Sun, 10 April 2011 02:17 Go to next message
Bio

 
Messages:63
Registered:April 2009
Location: Rhineland-Palatinate/Germ...
I reckon the public interest in this tool will be rather limited, but anyways, here it is my new command line tool for processing STI files.

First off: note that sticom only supports 8bit indexed (animated) STI files currently (and probably never will support single 16bit images since there is less need for batch processing these - there are already loads of tools for easily editing via GUI).

The need for this tool arose out of new requirements for STI processing by the BARE/JADES projects. The existing tools, namely sticon and STI tools which have been used until now for creating the STI files in BARE/JADES were not able to fulfill these requirements - partly because of bugs that never were resolved.

This new tool is supposed to replace both sticon and the STI tools and also to provide a lot of additional possibilities for creating and modifying STI files. It also makes it possible to render animated STI files to the console.

http://img18.imageshack.us/img18/927/bild2ya.png

Uploaded with ImageShack.us

Usage: sticom cmmand [options]
  input formats:
    COLOR        'RGB(red,green,blue)' - red, green, blue are the color values.
    PAIR         '(x,y)'               - x, y are the coordinates.
    RANGE        'n1-n2'               - n2 must be >= n1. 'FIRST' and 'LAST'
                                         can be used to to indicate the respect
                                         ive frames of the animation.
    HEX          '0x00' - '0xff'       - 8 bit hexadecimal value w/ 0x prefix.
  commands:
    append       Encodes and appends the specified input files to the specified
                 STI container.
    applypal     Applies the specified Adobe(tm) palette file to all the frames
                 inside of the STI container, by re-encoding all images.
    delete       Deletes the specified frames from the STI container.
    exppal       Exports the palette of the STI container as Adobe(tm) palette.
    extract      Extracts the specified frames either decoded or raw. You can s
                 pecify the colors used for background and shadow by the option
                 s -c and -S respectively.
    getkeydata   Outputs the key frame data for the specified range.
    getcolor     Outputs RGB triplet for the specified color of the palette.
    list         Lists all frames in the STI container and their offsets.
    imppal       Applies the specified Adobe(tm) palette file to the STI contai
                 ner, but does not re-encode the images. Indexes are preserved.
    insert       Inserts the specified input files into the STI container at th
                 e specified position.
    new          Creates a new STI container and appends the specified files.
    render       Renders the specified range of frames to the console.
    setcolor     Changes the specified color of the palette.
    setkeydata   Sets the key frame data for the animation.
    stats        Outputs stats like extents + pivot point about the animation.
  options:
    -0 --idx0    Use color of the console palette with index 0 for transparent
                  pixels when rendering to console.
    -a --ascii   If set, use only ascii characters for rendering on console.
    -A --alpha   Turn on alpha mode for the 'new' command. Expects two sets of
                  images, 2 palettes and 2 sti file names.
    -b --bpp     Use the specified value as bit depth for exported bitmaps.
    -B --bgpal   Use the transparent color of the palette for rendering to cons
                 ole.
    -c --color   Specifies a COLOR value for use with certain commands.
    -f --fps     Use the specified value as frames per second for rendering to
                 console.
    -e --empty   Write sti files, even if the stored size is 0.
    -F --fill    Repeat the provided keyframe data sequence to automatically cr
                 eate key frame data for the specified range.
    -i --input   Specifies input data - usually a file name or a format string
                 for formatting file names.
    -I --pixinc  Specifies how many lines/rows are skipped if rendering to cons
                 ole.
    -j --input2  Specifies input data - usually a file name or a format string
                 for formatting file names - for the 2nd set of images (for alp
                 ha channel sti files).
    -k --keydata Expects a list of HEX values that will be interpreted as keyfr
                 ame data. Values > zero signify for how many frames the keyfra
                 me spans.
    -m --mono    Don't use colors when rendering to console.
    -M --mode    Specified what encloding/decoding mode to use for exporting/im
                 porting frames. If no mode is specified, the images are import
                 ed/exported as-is. The following modes are supported:
                 Exporting:
                   PAD    - Pad all frames to the minimum common extents over a
                            ll frames. The offsets of all frames is presrved. Y
                            ou will need the pivot point coordinates to restore
                             the original positioning.
                   CENTER - Pad all frames so that the pivot point for the anim
                            ation is at the center of every image.
                 Importing:
                   TRIM   - Trim images prior to encoding. You usually would pr
                            ovide a common pivot point for all imported frames.
                   CENTER - Trim images prior to encoding. Use center of image
                             as pivot point.
    -n --index   Specified an index value. Used by commands, for instance to in
                 dicate a frame in the STI or a entry in the palette.
    -o --output  Specifies an output file name or format string for output file
                 names.
    -O --offset  PAIR of offset data for x and y axis, that will be added to th
                 e imported images.
    -p --palette Filename of an Adobe(tm) palette file.
    -P --pivot   PAIR of x, y coordinates specifying the pivot point.
    -q --pal2    Filename of an Adobe(tm) palette file for the second set of im
                 ages (for alpha channel sti files).
    -Q --quiet   Don't output meta-information to console.
    -r --range   RANGE value used for all commands that allow to process multip
                 le frames/images at once.
    -R --raw     Import/export in raw mode.
    -s --sti     Specified the input STI file.
    -S --shadow  Specifies a COLOR value. Used on export as the color for shado
                 ws.
    -t --trans   If set, keep transparency when applying a palette.
    -u --output2 Specifies the output file name for the alpha channel sti file.


It hasn't been thoroughly tested, so if anybody want's to test and report bugs, that would be appreciated. To be honest I had underestimated the overall complexity of the finalized tool, else I would have made it easier to test via unit tests.
BARE/JADES have not yet been re-factored to use sticom, so there are probably some bugs in this version still.

Some examples of how to use sticom:

Export all frames from A_SPIT.STI and output them as bitmap files into a subfolder. Pad the images so the pivot point of the animations is centered:
sticom extract -r FIRST-LAST -s A_SPIT.STI -o testframes/cen_%02d.bmp -M "CENTER"


Create a new STI file. Import all frames exported in the prior command. Use the specified palette file and also add a keyframe to every second frame:
sticom new -r 0-167 -i testframes/cen_%02d.bmp -F -o 0000_cen.sti -p grayscale.act -M CENTER -k "0x02 0x00"


Render the complete animation to the console.
sticom render -s A_SPIT.STI


Render only the last frame:
sticom render -n LAST -s A_SPIT.STI


Render the first 21 frames:
sticom render -r FIRST-20 -s A_SPIT.STI



The source is available via svn.

A build with the latest revision is downloadable here: sticom_rev4361.zip

[Updated on: Mon, 25 April 2011 10:49] by Moderator

Re: sticom - comprehensive command line tool for processing STI files[message #277615] Sun, 10 April 2011 10:38 Go to previous messageGo to next message
DepressivesBrot

 
Messages:3804
Registered:July 2009
Good to see you're still with us Bio. Was a bit worried this project would just disappear into oblivion.


Re: sticom - comprehensive command line tool for processing STI files[message #277619] Sun, 10 April 2011 11:09 Go to previous messageGo to next message
Logisteric

 
Messages:3381
Registered:December 2008
Location: B
:bow: :bow: :bow: :bow: :bow:
Re: sticom - comprehensive command line tool for processing STI files[message #277724] Mon, 11 April 2011 16:56 Go to previous messageGo to next message
Shadow21

 
Messages:334
Registered:November 2001
Location: on route to San Hermanos
great work Smile all we need now is someone who is capable of creating new renders Surprised
Re: sticom - comprehensive command line tool for processing STI files[message #278046] Sun, 17 April 2011 04:42 Go to previous messageGo to next message
SharkD

 
Messages:363
Registered:July 2003
Awesome!

Shadow21
great work Smile all we need now is someone who is capable of creating new renders Surprised


With JA: Reloaded coming out soon we should have tons of new ANIMATED models to use as the basis for sprites in 3DSMax or whatever!!
Re: sticom - comprehensive command line tool for processing STI files[message #278059] Sun, 17 April 2011 13:26 Go to previous messageGo to next message
Shadow21

 
Messages:334
Registered:November 2001
Location: on route to San Hermanos
SharkD
Awesome!

Shadow21
great work Smile all we need now is someone who is capable of creating new renders Surprised


With JA: Reloaded coming out soon we should have tons of new ANIMATED models to use as the basis for sprites in 3DSMax or whatever!!

pretty sure that wont work
Re: sticom - comprehensive command line tool for processing STI files[message #278535] Mon, 25 April 2011 07:27 Go to previous messageGo to next message
easterngames

 
Messages:28
Registered:April 2011
Location: Pennsylvania , USA
anyone know what file holds the bloodcat animations?


nvm, found em

[Updated on: Mon, 25 April 2011 07:33] by Moderator

Re: sticom - comprehensive command line tool for processing STI files[message #278541] Mon, 25 April 2011 10:52 Go to previous message
Bio

 
Messages:63
Registered:April 2009
Location: Rhineland-Palatinate/Germ...
I updated the download link and the usage info to the most recent revision. The old version produced sti files that could not actually be used in-game (though most STI-viewers played them just fine).

PS: could a mod please move this thread to the "v1.13 Projects (Released and In Progress)" sub-forum? Thank you!
Previous Topic: Single Click Installer for 1.13
Next Topic: LOBOT 0.1 (BETA) - Logical Bodytypes
Goto Forum:
  


Current Time: Fri Sep 20 17:23:07 EEST 2019

Total time taken to generate the page: 0.00927 seconds