Table of Contents
ArmA 2 How To Merge Satellite Texture Tiles
ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, ArmA 2 Tools
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.
2020-05-14 updated to Version: ImageMagick 7.0.10-11 Q16 x64 2020-05-09.
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
magick montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @top_left_input.txt satellite_top_left.png
Top Right Corner
magick montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @top_right_input.txt satellite_top_right.png
Bottom Left Corner
magick montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @bottom_left_input.txt satellite_bottom_left.png
Bottom Right Corner
magick montage -mode concatenate -size 16384x16384 -geometry -16-16 -tile 16x @bottom_right_input.txt satellite_bottom_right.png
Tiles Merge
Note: this part was not actually written for the Chernarus satellite merge tutorial, but you see how you can use the below for this purpose.
This process takes your 20480 resolution satellite mask and texture TILES (top left, top right, bottom left and bottom right) and combines them into 40960 resolution image. Then it resizes tiles into 1024 size for visitor 3 importing jiggle.
@echo off echo this process takes forever, several HOURS. Are you sure you want to proceed? pause set MAGICK_TEMPORARY_PATH=c:\imagemagick_temp echo processing 40960 Satellite Mask... magick montage -mode concatenate -size 40960x40960 @chops-list-mask.txt Satellite_MONSTER_40K_mask_lco.png echo processing 40960 Satellite Texture... magick montage -mode concatenate -size 40960x40960 @chops-list-texture.txt Satellite_MONSTER_40K_texture_lco.png echo processing 1024 Satellite Mask... magick convert Satellite_mask_lco.png -resize 1024x1024 Satellite_mask_1024_lco.png echo processing 1024 Satellite Texture... magick convert Satellite_texture_lco.png -resize 1024x1024 Satellite_texture_1024_lco.png echo finally, all done. Thank you :) pause
chops-list-mask.txt:
Satellite_mask_lco.png Satellite_mask_lco.png Satellite_mask_lco.png Satellite_mask_lco.png
chops-list-texture.txt:
Satellite_texture_lco.png Satellite_texture_lco.png Satellite_texture_lco.png Satellite_texture_lco.png
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.
To further tweak your imagemagick to handle large satellite image sizes, please refer to ImageMagick page.