Page 2 of 2

Re: Tile smaller image over a background with offsets?

Posted: 2018-10-04T08:30:46-07:00
by grape
fmw42 wrote: 2018-10-03T16:13:33-07:00 In IM 7 on Unix, this seems to do what I think you want.

Code: Select all

WxH=`magick stars.jpg -format "%wx%h" info:`
ww=`echo "$WxH" | cut -dx -f1`
hh=`echo "$WxH" | cut -dx -f2`
centx=`magick xc: -format "%[fx:round($ww/2)]" info:`
xx=$((centx))
yy=0
i=0
echo "$hh; $ww; $centx; $xx; $yy;"
magick stars.jpg result.png
while [ $xx -lt $ww -a $yy -lt $hh ]; do
echo "$xx; $yy;"
magick result.png \( cat.png +repage -resize 50% \) -gravity northwest -geometry +${xx}+${yy} -compose over -composite result.png
echo ""
i=$((i+1))
xx=`magick xc: -format "%[fx:$i%2==1?($xx-100):($xx+100)]" info:`
yy=$((yy+100))
done
magick result.png stars_cat3.jpg
rm -f result.png
Image
O WOW!! That is very comprehensive. Thank you so much for taking the time to help me out here. You really know your way around command line and IM. This is friggin awesome. Thank you so much

Re: Tile smaller image over a background with offsets?

Posted: 2018-10-04T09:34:57-07:00
by fmw42
I wrote:

Code: Select all

while [ $xx -lt $ww -a $yy -lt $hh ]; do
But since you are constraining your positioning width-wise already, the width test could be removed so that the command is just on the height.

Code: Select all

while [ $yy -lt $hh ]; do