While I no longer actively mod, I still remember that I had a lot of issues with those tools as well and it annoyed me vastly. When fook contacted me the day before yesterday, having again issues with tgasplit, I decided to follow the modder's creed: If it doesn't exist, do it yourself.
So, I present you a new tool, which I label "Snip'n'Stitch". It is a lightweight Java app that will be able to SNIP images into predefined segments and also will be able to STITCH a set of images together into a new image.
The number of segments for width/height can differ (should you need that for whatever reason. Probably not helpful for terrain editing, but I like to keep my apps as open and multifunctional as possible). Using "bad" divisors that require uneven cuts (e.g. splitting a 100x100 image into 7 segments) will lead to a row/column of pixels being MISSING somewhere, so get your math right.
"Naming scheme" allows you to customize your desired output segments' names. For this there are two predefined pointers, {x} and {y}. Place these inside the name scheme, and they'll be used to count the segment indices.
For Battlefield 1942, the naming scheme would look like this: "Tx{x}x{y}".
"Leading zeros" allows you to specify the number of leading zeros you want the indices to have. E.g. Battlefield terrain textures start counting at "Tx00x00". This means that you will require 2 leading zeros so the segments match up the name.
Another example (the one I use for the tooltip as well)
The number of leading zeros used for {x} and {y}. A value of 3 means:"
2 will be labeled as "002"
22 will be labeled as "022"
222 will be labeled as "222"
2222 will be labeled as "2222"
Planned features
- Warning when a desired segmentation leads to impure cuts (segment width with decimal pixel values).
- Impure cuts should not lead to missing pixels, but rather the questionable row should be filled with the nearest neighbour value (or black) to retain original image size in segments.
- Support for more image formats (DDS won't come, sorry, but there's just no proper Java API for that).
The tool is still far from being finished, but as fook requires this "ASAP", I decided to push a first release with the current limited featureset (call it beta, if you will).
INSTALLATION
1: This tool is a java app. This means that you HAVE to have Java 7 installed.
2: This tool is Multi-OS and uses the native OS GUI. Currently it supports both 32bit and 64bit Windows as well as 32/64bit Unix/Linux-based OS. OSX might come in the future.
3: As it's a java app, there is no installation. Simply extract the archive and doubleclick the ".jar". If for whatever reason this does not work on your PC, I also added a comfy "start.bat" that runs the proper launch command on the .jar. This is just a failsafe and can be deleted if double-click works.
4: If you REALLY want to save a couple of MB, you can delete all the ".jar" files inside the lib that do not fit your OS. This might be automatically done by an installer in the future...
USAGE
Self-explanatory, I think. Hover over customizable fields to get a helpful tooltip if you need it.
Take not that the "SNIP" button only becomes active once you have filled in all necessary values. The naming scheme for example must contain both the {x} and {y} variable somewhere.
All settings will be stored in a local file in the same folder (settings.properties) and be automatically restored whenever you launch the tool again.
DOWNLOAD VERSION 4
Changelog
v4 - 09.Jun 13
- Settings.properties renamed to settings.txt to make it clear it's a simple editable text file. If you still have the .properties file, either delete it or rename it to .txt to transfer settings.
- Missing settings no longer lead to crash on startup (the file can be missing completely, and as such is no longer included in the distribution).
- Stitch feature added. This feature allows to specify an input directory containing your segment images. By defining the pattern in which the X/Y directions are included in the filenames, the tool will arrange the the images according to that and generate/save a mosaiced image.
For the XY detection to work, you need to specify the naming pattern by using the two variables <*x> and <*y>. The tool will search your image filenames for occurences of these and understand it. The way it currently works is:
The number of leading zeros doesn't matter at all, so using the scheme Tx<*x>x<*y> will fit and be understood for all the following file names.:
Tx001x114
Tx1x114
Tx00000001x114
After selecting an input folder and a valid naming pattern, you also will get a preview of how your stitched image will look like. - Changelog shows when informing about version update
- Program no longer fails to start if no imgin in the settings.properties is specified (draws dummy image instead)
- Fixed bugs with the scroll bars of the preview image, practically making them useless and messing up the preview for big images.
- Fixed bugs with resizing the preview image (related to above, mostly)
- Added a start.bat again for convenient launch on systems with faulty jarfile registry entries.
- Reads TGA files now. No write (as TGA is a deprecated image format, there never will be write support).
- KNOWN BUG: Do NOT delete the settings.properties. Missing settings for "leadzero" and "naming" will cause the program to FAIL to start up. Will be fixed in a next version...
- Preview for snip, showing the resulting cut lines directly on top of the input image.
- Automated check for new versions (yay). If an update exists, a popup will allow you to get a direct download link to the new 7z archive. No self-updater (yet?), sorry.
- First release (only includes "Snip" feature)