User Tools

Site Tools


tools:l3dt:mosaic-stitching-imagemagick

L3DT Mosaic Stitching ImageMagick

L3DT

2022-06-25T15:35:00Z

How to create one satellite image out of L3DT saved mosaic tiles using Imagemagick.

Save the attributes and texture layers in L3DT using 5 x 5 mosaic's. This mosaic size is nice because lets say you make common 20480 x 20480 resolution satellite, it will mosaic into 4096 x 4096 tiles (5 x 5).

BTW Creating 20480 resolution attributes and texture with L3DT takes about 2 - 4hours depending on your computer speed.

Use (in this example) for mask: Satellite_mask_mosaic and for texture: Satellite_texture_mosaic file names.

Write the MASK file names into “mosaic_mask.txt” file, which in our example looks like this:

Satellite_mask_mosaic_x0y4.png
Satellite_mask_mosaic_x1y4.png
Satellite_mask_mosaic_x2y4.png
Satellite_mask_mosaic_x3y4.png
Satellite_mask_mosaic_x4y4.png
Satellite_mask_mosaic_x0y3.png
Satellite_mask_mosaic_x1y3.png
Satellite_mask_mosaic_x2y3.png
Satellite_mask_mosaic_x3y3.png
Satellite_mask_mosaic_x4y3.png
Satellite_mask_mosaic_x0y2.png
Satellite_mask_mosaic_x1y2.png
Satellite_mask_mosaic_x2y2.png
Satellite_mask_mosaic_x3y2.png
Satellite_mask_mosaic_x4y2.png
Satellite_mask_mosaic_x0y1.png
Satellite_mask_mosaic_x1y1.png
Satellite_mask_mosaic_x2y1.png
Satellite_mask_mosaic_x3y1.png
Satellite_mask_mosaic_x4y1.png
Satellite_mask_mosaic_x0y0.png
Satellite_mask_mosaic_x1y0.png
Satellite_mask_mosaic_x2y0.png
Satellite_mask_mosaic_x3y0.png
Satellite_mask_mosaic_x4y0.png

Write the TEXTURE mosaic file names into “mosaic_texture.txt” file, which in our example looks like this:

Satellite_texture_mosaic_x0y4.png
Satellite_texture_mosaic_x1y4.png
Satellite_texture_mosaic_x2y4.png
Satellite_texture_mosaic_x3y4.png
Satellite_texture_mosaic_x4y4.png
Satellite_texture_mosaic_x0y3.png
Satellite_texture_mosaic_x1y3.png
Satellite_texture_mosaic_x2y3.png
Satellite_texture_mosaic_x3y3.png
Satellite_texture_mosaic_x4y3.png
Satellite_texture_mosaic_x0y2.png
Satellite_texture_mosaic_x1y2.png
Satellite_texture_mosaic_x2y2.png
Satellite_texture_mosaic_x3y2.png
Satellite_texture_mosaic_x4y2.png
Satellite_texture_mosaic_x0y1.png
Satellite_texture_mosaic_x1y1.png
Satellite_texture_mosaic_x2y1.png
Satellite_texture_mosaic_x3y1.png
Satellite_texture_mosaic_x4y1.png
Satellite_texture_mosaic_x0y0.png
Satellite_texture_mosaic_x1y0.png
Satellite_texture_mosaic_x2y0.png
Satellite_texture_mosaic_x3y0.png
Satellite_texture_mosaic_x4y0.png

Notice how the coordinates go from x0, y4 - top left to x4, y0 - bottom right. If you would use different number of mosaics, this file list would have to be changed accordingly.

Then create DOS .bat file like this:

magick montage -mode concatenate -size 20480x20480 @mosaic_mask.txt Satellite_mask_lco.png
magick montage -mode concatenate -size 20480x20480 @mosaic_texture.txt Satellite_texture_lco.png
pause

Now just execute the .bat file and you have the mask and texture PNG's saved nicely.

Please note that the Satellite_mask_lco.png is saved in Indexed color mode, if you attempt to import it to Visitor 3, it will crash. You must open it in Photoshop, change to RGB color and save. You should also open and save the Satellite_texture_lco.png image too although it comes out from ImageMagic as RGB color image.

Tip; if your montage run fails or gets stuck just running endlessly, reboot your computer to do fresh start, then try again and most likely it will run OK.

tools/l3dt/mosaic-stitching-imagemagick.txt · Last modified: 2022-06-25 15:38 by snakeman