Debian Codegraph @

source/assets/2d/2D improvement/numbers-convert

raw
1 #!/bin/bash
2
3 convert -size 64x64 xc: -fx "Xi=i-w/3; Yj=j-h/3; 1.5*(0.6-hypot(Xi,Yj)/50.0)+0.7" gradient.png
4
5 cd numbers_sources_wide
6
7 for file in *.png;
8 do
9 n=`basename $file .png` # Filename
10
11 # making the temporary image
12 convert $file ../temp.tga
13
14 # adding 3D like light, 1x1 means the width of the edge (1px)
15 convert ../temp.tga \
16 -fx A -blur 1x1 -shade 135x50 \
17 ../temp.tga
18
19 # adding the texture, comment out this section, if you don't want any textures to be added
20 convert ../temp.tga ../numbers_texture.png \
21 -compose multiply -composite \
22 ../temp.tga
23
24 # adding light gradient
25 convert ../temp.tga ../gradient.png \
26 -compose multiply -composite \
27 ../temp.tga
28
29 # masking the result with the original
30 convert ../temp.tga $file \
31 -compose dst-in -composite \
32 ../bin/numbers/$n.tga
33 done
34
35 rm ../gradient.png ../temp.tga