Cropping and not resizing

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
EdwardOwen

Cropping and not resizing

Post by EdwardOwen »

I'm a brand new user to this program, and could use some help.

I'm already downloading a series of radar data files from the National Weather Service, merging them to a standard background, then using an AVI constuction program to make a simple loop of about 25 frames.

I'm using a command line within a batch file to merge the two graphics files, then saving them under another name. Works fine.

The problem is, the graphics files I'm downloading are 650X550, and I need to crop them down to 640X480. I would prefer to do this from the center of the picture but I'll take whatever I can get.

On a secondary note, once I get this going, I'll want to crop to an even smaller section of the center of the frames, then save it as 640X480.

I'll be glad to study up on this, but so far the documentation has confused me as all I can figure out how to do is to resize, keeping the aspect ratio, which won't work for my application.

Thanks!
ed
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Cropping and not resizing

Post by el_supremo »

to crop the centre, try this:

Code: Select all

convert input_file -gravity center  -crop 640x480+0+0 +repage output_file
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
EdwardOwen

Re: Cropping and not resizing

Post by EdwardOwen »

Thanks Pete! I'll try it right away.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cropping and not resizing

Post by fmw42 »

EdwardOwen

Re: Cropping and not resizing

Post by EdwardOwen »

Thanks for the suggestions. I'll check up on it. The command line above isn't causing my file to save properly. It's not leaving anything when I run it. I double checked all the parameters, but something isn't working right.

Thanks again.
EdwardOwen

Re: Cropping and not resizing

Post by EdwardOwen »

Got it!
Had an error in my directory command.
Thanks again.
Post Reply