Page 1 of 1

Split and image into two equal parts.

Posted: 2017-12-08T16:54:38-07:00
by Valkarin
Need help. I'm trying to split an image into two parts. The original is 1272x954. I need to split it in half so I get two images that are 636x954. I have tried:

Code: Select all

magick convert out00.png -crop 50%x100% +repage splitleftout%02d.png
and:

Code: Select all

magick convert out00.png -crop 636x954 +repage splitleftout%02d.png
I always get eight images of varying size. Three that are *x848, three that are *x106 and two that are 1x1.

When I try:

Code: Select all

magick convert out05.png -crop 636x954+0+0 +repage splitleftout%02d.png

I get one image that is 312x848 starting at the top left of the original image.

I have looked at the documentation and googled until my eyes hurt. What am I missing/doing wrong?

Also, Im on a windows 10 system if that makes a difference.

Re: Split and image into two equal parts.

Posted: 2017-12-08T17:05:03-07:00
by snibgo
You need an "at", "@":

Code: Select all

-crop 2x1@ +repage
This chops it into two pieces horizontally, but only one vertically.

It is documented, at http://www.imagemagick.org/script/comma ... s.php#crop

Re: Split and image into two equal parts.

Posted: 2017-12-08T17:09:34-07:00
by fmw42
This should have worked and given only two pieces.

Code: Select all

magick out00.png -crop 50%x100% +repage splitleftout%02d.png
Note in IM 7, magick replaces convert. For other modules such as identify and mogrify, etc., you need to precede them with magick. So magick identify or magick mogrify.

Using magick convert may lead to the use of IM 6 convert rather than IM 7.

Please always provide your exact IM version and platform when asking questions.

Re: Split and image into two equal parts.

Posted: 2017-12-08T17:15:32-07:00
by Valkarin
Thanks a lot. I saw the @ in the documentation, but didn't understand it.