rotation of large image file

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
robgfx

rotation of large image file

Post by robgfx »

Hi folks

So I've been trying to batch process a number of geographic image files. They need to be rotated at unique angles. Since they are map files, they are very high res. I'm getting an error where if I do:

convert ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png

My final image does not actually rotate, instead it comes back with the canvas resized (to the correct size if it were rotated) with the original image at the top and a lot of black in the bottom half. The image is 14997x5592 pixels, and this command works for all other images, so I suspect it's a memory issue and IM is just crashing without a message.

Note, if I do:
convert ./myImage.png -rotate '-40>' ./myImage-rotated.png
It runs for about 3 min. then I get this error:
convert: Memory allocation failed 'Cannot allocate memory'.

I am using ImageMagick 6.4.0 04/17/08 Q16 (32-bit, although I am running XP x64)

So it seems like a memory allocation constraint. I have 4G on my machine and the convert process is using 664,000KB which I assume is the limit?

Any advice?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: rotation of large image file

Post by magick »

> convert ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png

Its always a good idea to upgrade but this may work as well:
  • convert -limit memory 1mb ./myImage.png +distort SRT -40 +repage ./myImage-rotated.png
If that fails, add -limit map 1mb to your command line. If that fails you may not have enough temporary disk space. If you have a non-standard disk partition you can use it for the ImageMagick pixel cache with this option:
  • -define registry:temporary-path=f:\tmp
robgfx

Re: rotation of large image file

Post by robgfx »

I upgraded to 6.4.2 (last week's release) and downloaded the windows 64-bit binaries, went into /cygwin/usr/bin and moved that old convert.exe and replaced it with a symbolic link to the new imagemagick, and this rotation now works!

So I don't know if it was the 64-bit build or simply the updated version that fixed this for me, but I got it working.

Thanks magick.
Post Reply