Hello,
I'm trying to crop image by height with this command line :
convert 1053257.png -gravity South -crop 2910x3312+0+0 -background black +repage image-cropped-top.png
the generated image is not cropped correctly the dimension after running command are 2791x3312
the width is cropped as well !!
can anyone help with this pls ?
crop image only in height
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: crop image only in height
Please tell us the version of IM you are using, and on what platform, and please paste a link to your input file.
snibgo's IM pages: im.snibgo.com
Re: crop image only in height
I'm using imagemagick version 6.9.10-Q16 on windows 10
Actually I trim the image first and then I do the crop
here the link to the image:
https://s3.eu-central-1.amazonaws.com/c ... inal-2.png
Actually I trim the image first and then I do the crop
here the link to the image:
https://s3.eu-central-1.amazonaws.com/c ... inal-2.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: crop image only in height
So I expect you also "+repage" after the trim? Please show the exact command or series of commands you use. Otherwise we can only guess.razor74 wrote:Actually I trim the image first and then I do the crop
Inserting "+write info:" at various stages in your command can help with understanding what is happening.
snibgo's IM pages: im.snibgo.com
Re: crop image only in height
here the series of command I do:
convert original-1.png -trim original-1-trimmed.png
convert original-1-trimmed.png -gravity South -crop 2910x3312+0+0 +repage original-1-cropped-top.png
convert original-1.png -trim original-1-trimmed.png
convert original-1-trimmed.png -gravity South -crop 2910x3312+0+0 +repage original-1-cropped-top.png
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: crop image only in height
When you "-trim" an image it will remember the original page dimensions, then when you crop the image it uses those page dimensions as the starting reference for the crop. You need to "+repage" before the crop to start with fresh paging information. Try this...
Code: Select all
convert original-1.png -trim +repage -gravity South -crop 2910x3312+0+0 +repage original-1-cropped-top.png
Re: crop image only in height
Thanks a lot is solve my issue.