I'm not sure how to do any cropping as part of a magick import
so I'll import and forward to a regular magick
command for processing.
To mimic your approach, that would be:
magick import -window root png:- | magick png:- \
\( -clone 0 -crop 1280x400+0+0 \) \
\( -clone 0 -crop 1280x400+0+400 \) \
-delete 0 +append result.png
That first grabs the screen with import
and pipes it on as a PNG to a second command that clones the image and crops the left half, clones it again and crops the right half, deletes the original and places the two crops side-by-side.
There is an easier way that works for you though. If you crop without an offset, all the cropped areas will remain in your stack:
magick import -window root png:- | magick png: -crop x50% +append result.png
Note: I am also using 50% of the height as the crop to save me having to do any maths
Note: If you want a magenta gap between the two halves, add -background magenta
near the start and replace +append
with +smush 10
to place them 10 pixels apart.