I have these coordinates and the input image below.
coords="110x16+255+175
178x59+29+65
178x59+223+65
178x59+417+65
178x59+611+65
240x151+462+176
240x151+87+257
240x151+366+355
240x151+77+448
240x151+468+542
240x151+140+624"
areas.png
For the first 5 coordinates I apply this code (images 0 to 4):
Code: Select all
(
for coord in $coords; do
echo >&2 "$coord"
convert areas2.png +repage -crop $coord +repage -bordercolor black -border 2x2 miff:-
done
) | \
convert - -write mpr:img -delete 0--1 \( mpr:img[1,2] -smush -2 \) \( mpr:img[3,4] -smush -2 \) \
+smush -2 mpr:img[0] +swap -gravity center -background none -smush +3 ImgHeader.png
But it seems I cannot use the first subshell code where was stored the frames in miff memory for the rest of the coordinates.
So, when I run these 3 command failed.
Code: Select all
convert - -write mpr:img -delete 0--1 \( mpr:img[5,6] +smush +6 \) \
+smush -2 LeftRight.png +swap -gravity center -background none -smush +3 ImgTop.png
convert - -write mpr:img -delete 0--1 \( mpr:img[7,8] +smush +6 \)\
+smush -2 LeftRight.png +swap -gravity center -background none -smush +3 ImgMiddle.png
convert - -write mpr:img -delete 0--1 \( mpr:img[9,10] +smush +6 \) \
+smush -2 LeftRight.png +swap -gravity center -background none -smush +3 ImgBottom.png
The outputs would be like this:
ImgHeader.png
ImgTop.png
ImgMiddle.png
ImgBottom.png
LeftRight.png (This is only a helper image to use it to put the header over each resulting image)
Thanks in advance for any help.