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
![Image](https://www.dropbox.com/s/8nznauaszs4qegh/areas2.png?raw=1)
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
![Image](https://www.dropbox.com/s/rueuveglcg8vazs/ImgHeader.png?raw=1)
ImgTop.png
![Image](https://www.dropbox.com/s/5v4xgmcomf9hknb/ImgTop.png?raw=1)
ImgMiddle.png
![Image](https://www.dropbox.com/s/9dis05ge0c37wvx/ImgMiddle.png?raw=1)
ImgBottom.png
![Image](https://www.dropbox.com/s/rojdkfu05w6bws1/ImgBottom.png?raw=1)
LeftRight.png (This is only a helper image to use it to put the header over each resulting image)
![Image](https://www.dropbox.com/s/ujzdn6txxc8t8qm/LeftRight.png?raw=1)
Thanks in advance for any help.