Page 1 of 1

probably simple, but I don't understand!

Posted: 2007-08-16T05:48:01-07:00
by Ic3Knight
Hi,

I'm pretty much a complete novice with imagemagick, so I hope someone out there can help me with this!

I'm doing some computer simulations and the output from the model is a series of .png images. I have used image magick in the past to convert these pngs to a single animated gif, which is nice and simple. Now, I want to select only a specific area of each image, scale that up a bit and then make a new gif of these enlargements... I've managed to do the crop and resize without problem to generate a second set of .pngs of the appropriate location in the original images. But when I convert this set of pngs to a gif, the resulting image retains the aspect ratio of the original set of images with the cut out section that I want sat in the middle... These are the commands I used:

convert stub*.png -crop 94x140+28+120 -resize 400 zoom%04d.png

and then

convert zoom*.png zoom.gif

but like I say, rather than getting a single gif with the dimensions of the "zoom*.png" images, I get one with an enlarged version of the original images, but with only grey except for where my cropped region was... what am I doing wrong? The individual zoom*.png images all have the correct ratio (400x596)...

Any advice would be greatly appreciated!

Thanks

Paul

Re: probably simple, but I don't understand!

Posted: 2007-08-16T10:54:17-07:00
by Bonzo
I have no experiance of this Paul but would it be something like -page http://www.imagemagick.org/script/comma ... s.php#page or -repage http://www.imagemagick.org/script/comma ... php#repage ?

Re: probably simple, but I don't understand!

Posted: 2007-08-18T16:30:36-07:00
by anthony
Bonzo is on the right track.. Add +repage after the -crop to remove the preserved virtual canvas information that teh GIF format is using.

Your animation is croped and reszied, but offset on a larger canvas in the GIF animation.

See IM Examples on Crop for general info on the prblem but also
http://www.imagemagick.org/Usage/anim_mods/#crop
which shows and explains the problem you see. The next set of examples explain another solution to reseting the virtual canvas information for more general (frame optimized) GIF animations.