from random import randint
stamp_size=100
# this depends on the image to be stamped on
hofs_max=int((stamp_size/2) * 0.7)
vofs_max=int((stamp_size/2) * 0.5)
# h_step = int(stamp_size * 0.8)
# v_step = int(stamp_size * 0.7)
h_step = int(h_max / h_count)
v_step = int(v_max / v_count)
cmd=""
for v in range(0, int(v_max), v_step):
for h in range(0, int(h_max), h_step):
v_pos = v + randint(-vofs_max, vofs_max)
h_pos = h + randint(-hofs_max, hofs_max)
rot = randint(0, 360)
cmd+=f"( ( {stamp_name} {stamp_op} ) -rotate {rot} -geometry {stamp_size}x{stamp_size}^{h_pos:+}{v_pos:+} ) -composite "
return cmd
from random import randint
# this depends on the image to be stamped on
h_ofs_max=int((stamp_h/2) * 0.7)
v_ofs_max=int((stamp_w/2) * 0.5)
h_step = int(stamp_h * 1.5)
v_step = int(stamp_w * 1.5)
cmd=""
for v in range(0, int(v_max), v_step):
for h in range(0, int(h_max), h_step):
v_pos = v + randint(-v_ofs_max, v_ofs_max)
h_pos = h + randint(-h_ofs_max, h_ofs_max)
cmd+=f"( ( {stamp_name} {stamp_op} ) -geometry {stamp_h}x{stamp_w}^{h_pos:+}{v_pos:+} ) +repage -composite "
return cmd
convert -size 1000x1000 xc:white -compose Multiply \( -alpha set -channel A -fx 0.7 m.png \) -composite composite.png 2>&1>/dev/null
echo ./composite.png