1

It's been awhile since I've played with Imagemagick. I do remember crop and I can take an image named foo.png and use:

convert foo.png -gravity north -crop 1000x100 bar.png

but my output is:

bar-0.png
bar-1.png
bar-2.png
bar-3.png
...

When I only want what's in bar-0.png.

I've researched around and found:

What is the correct way to crop an image and just get the first return? I'm not not worried about the aspect ratio or the size of the images. I'm just trying to get a sample of the image's first 100px.

1 Answer 1

3

You need to add the information from which X and Y you want to start, otherwise Imagemagick will repeat the crop:

convert foo.png -gravity north -crop 1000x100+0+0 bar.png
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.