Command line -scale and -resize not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Cybert99
Posts: 2
Joined: 2012-05-25T12:00:58-07:00
Authentication code: 13

Command line -scale and -resize not working

Post by Cybert99 »

I'm passing the following to ImageMagick through Excel (VBA):

Code: Select all

convert.exe filename.jpg -clip 440x236+535+304 -scale 216x116 newname.png
The resulting image is supposed to be 216x116 but instead it's 155x116. What am I doing wrong?

NOTE: I was initially clipping an image size of 440x210 and "-scale" gave me an image size of 216x103. I then tried "-resize" but this gave me an image size of 155x116. So I went back to "-scale" and made sure the aspect ratio of the clipped image was the same as the output image. But now "-scale" is giving me images that are 155x116.

I'm very confused!
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Command line -scale and -resize not working

Post by Bonzo »

I would say you want -crop not -clip as -clip works with a clipping path and you are not suppling one.

Code: Select all

convert.exe filename.jpg -crop 440x236+535+304 -resize 216x116 newname.png
Cybert99
Posts: 2
Joined: 2012-05-25T12:00:58-07:00
Authentication code: 13

Re: Command line -scale and -resize not working

Post by Cybert99 »

I added a "!" using the "-resize" command and it looks like it's working now...
Post Reply