This is an old revision of the document!
Table of Contents
How To Merge Satellite Texture Tiles
ArmA 2 Satellite Texture / Mask Merging
How to merge those hundreds of satellite texture tiles back together into one big satellite texture image.
If you ever wanted to see other peoples / BIS terrains textures in one big image or perhaps you lost your own Photoshop psb image for your project, this is the method to use to recover that big image once again.
This method requires BIS Tools pal2pace which can be found on texview2 directory and ImageMagick image tool.
Our example is made for BIS terrain Chernarus, its 15360 x 15360 resolution satellite image and its PNG file list is 1024 PNG's long. Other terrains have various sizes and you have to adjust this tutorial accordingly.
PAA to PNG
First you need to convert the hundreds of PAA files into PNG format. In this example our pal2pace is located in path.
MD temp FOR /F "tokens=1* delims=. " %%A in ('dir /b *.paa') do ( Pal2PacE %%A.paa temp\%%A.png if ERRORLEVEL 1 goto err )
The above dos bat file creates directory called “temp” and places the converted PNG files there.
At this point you should use explorer and go to this temp directory.
PNG Lists
Please remember that this is specific for Chernarus satellite texture size, other terrains may (and will) vary in sizes!
Next you need to create text file list of the PNG file names. These file names are the satellite map range on top left, top right, bottom left and bottom right corners of the map.
This is quick summary of the file name ranges:
Corner | File Name Range |
---|---|
Top Left | 000_000 → 015_015 |
Top Right | 016_000 → 031_015 |
Bottom Left | 000_016 → 015_031 |
Bottom Right | 016_016 → 031_031 |
Practical short example here, although its pointless to paste the full four lists here as its quite long:
s_000_000_lco.png s_001_000_lco.png s_002_000_lco.png s_003_000_lco.png s_004_000_lco.png s_005_000_lco.png s_006_000_lco.png s_007_000_lco.png s_008_000_lco.png s_009_000_lco.png s_010_000_lco.png s_011_000_lco.png s_012_000_lco.png s_013_000_lco.png s_014_000_lco.png s_015_000_lco.png s_000_001_lco.png s_001_001_lco.png s_002_001_lco.png s_003_001_lco.png s_004_001_lco.png s_005_001_lco.png s_006_001_lco.png s_007_001_lco.png s_008_001_lco.png s_009_001_lco.png s_010_001_lco.png s_011_001_lco.png s_012_001_lco.png s_013_001_lco.png s_014_001_lco.png s_015_001_lco.png
Etc …
As you can see the numbers go from 000 to 001 and all the way until 015 for this top left corner PNG list.
Name the lists like: top_left_input.txt, top_right_input.txt, bottom_left_input.txt and bottom_right_input.txt names.
ImageMagick Command Line
Next we use ImageMagick to create “montage” image of all these small satellite texture “tiles”. The following command's assume your ImageMagick is located in path.
The text file after the @ sign is the list of the current corners PNG file names.
Each of the corner pieces merges into 7680 x 7680 resolution image.
Top Left Corner
montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @top_left_input.txt satellite_top_left.png
Top Right Corner
montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @top_right_input.txt satellite_top_right.png
Bottom Left Corner
montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @bottom_left_input.txt satellite_bottom_left.png
Bottom Right Corner
montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @bottom_right_input.txt satellite_bottom_right.png
Photoshop Merge
Finally we make 15360 x 15360 image in Photoshop, open all the corner satellite pieces and paste them in the right places in the large final image, then flatten the image.
All done.
Notes
As said this tutorial is for BIS terrain Chernarus satellite size, other terrains vary in sizes so you must adjust the satellite resolutions accordingly.
The satellite is merged in four pieces because even when split up to four the sizes are 7680 x 7680 per piece, however ImageMagick can merge even four 20480 x 20480 resolution images to one huge 40960 x 40960 res image.
Same method applies to mask files of course.
If you run out of memory, ImageMagick needs to swap to temp dir/file, if the drive it tries to swap gets full you can define new drive/path like this:
set MAGICK_TEMPORARY_PATH=d:\imagemagickswap
You can use what path you wish there.