Skip to content

Commit f1346b9

Browse files
committed
Added tools for merge and extraction of cubemap images
1 parent 0df5c4e commit f1346b9

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
3+
set /p imgSz="Image size: "
4+
set /p borderSz="Border size: "
5+
set /a extractedImgSz=imgSz-2*borderSz
6+
7+
set /p img="Image to extract from: "
8+
9+
set /p right="Right path: "
10+
set /p left="Left path: "
11+
set /p top="Top path: "
12+
set /p bottom="Bottom path: "
13+
set /p front="Front path: "
14+
set /p back="Back path: "
15+
16+
set /a x0 = borderSz
17+
set /a x1 = imgSz+borderSz
18+
set /a x2 = 2*imgSz+borderSz
19+
set /a y0 = borderSz
20+
set /a y1 = imgSz+borderSz
21+
22+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x0%+%y0% %right%
23+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x1%+%y0% %left%
24+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x2%+%y0% %top%
25+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x0%+%y1% %bottom%
26+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x1%+%y1% %front%
27+
magick convert %img% -crop %extractedImgSz%x%extractedImgSz%+%x2%+%y1% %back%
28+
29+
PAUSE
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
3+
set /p sz="Image size: "
4+
set /a szx2=2*sz
5+
set /p ext="Image extension: "
6+
set /a outputWidth=3*sz
7+
set /a outputHeight=2*sz
8+
9+
set /p right="Right path: "
10+
set /p left="Left path: "
11+
set /p top="Top path: "
12+
set /p bottom="Bottom path: "
13+
set /p front="Front path: "
14+
set /p back="Back path: "
15+
16+
magick convert -size %outputwidth%x%outputHeight% canvas:skyblue ^
17+
-draw "image over 0,0 0,0 '%right%'" ^
18+
-draw "image over %sz%,0 0,0 '%left%'" ^
19+
-draw "image over %szx2%,0 0,0 '%top%'" ^
20+
-draw "image over 0,%sz% 0,0 '%bottom%'" ^
21+
-draw "image over %sz%,%sz% 0,0 '%front%'" ^
22+
-draw "image over %szx2%,%sz% 0,0 '%back%'" ^
23+
output.%ext%
24+
25+
PAUSE

0 commit comments

Comments
 (0)