-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bat
39 lines (30 loc) · 929 Bytes
/
run.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
setlocal EnableDelayedExpansion
set geometry=160x160+41+15
set base=%~dp0base
set inputs=%~dp0inputs
set outputs=%~dp0outputs
set t=%~dp0temp
if not exist %outputs% mkdir %outputs%
if not exist %t% mkdir %t%
set 0=!base!\0.png
set 1=!base!\1.png
for %%i in (!inputs!\*) do (
echo %%~nxi: converting...
set x=!inputs!\%%~nxi
set filenames=
magick convert "!0!" "!x!" -gravity Center -geometry !geometry! -composite "!1!" -composite !t!\temp.png
for %%r in (256 64 48 40 32 24 20) do (
set res=%%rx%%r
set filename=!t!\temp-%%r.png
set filenames=!filenames! !filename!
magick convert !t!\temp.png -scale !res! !filename!
)
set filename=!t!\temp-16.png
set filenames=!filenames! !filename!
magick convert !x! -scale 16x16 !filename!
magick convert !filenames! !outputs!\%%~ni.ico
del !t!\*.png
echo %%~nxi: done.
)
explorer !outputs!