Search code examples
windowsimagemagickimagemagick-converthard-drivecolor-palette

memory problems with imageMagick?


I have problems using convert F:\path\source.png -define registry:temporary-path=F:\path -limit area 0 -type palette -colors 256 F:\path\target.png

the temporary-path and my source and target images are on an external hard drive. I used area 0 because I don't want ImageMagick to use my systems memory or C:.

The error(s) I am getting:

convert.exe: unable to open image `F:\path\target.png': File exists @ error/blob.c/OpenBlob/2709.

and

convert.exe: WriteBlob Failed `F:\path\target.png' @ error/png.c/MagickPNGErrorHandler/1645.

Solution

  • Just some general advice really on dealing with problems with ImageMagick and large images.

    1. If you are dealing with images that are tens of thousands of rows by tens of thousands of columns, that can pretty soon mount up and exceed the limits of a 32-bit OS and ImageMagick binary, so make sure you are running 64-bit.

    2. Beware of seeing that you have a 130GB filesystem, and assuming that means you can write a 130GB file, since FAT filesystems are limited to no individual file exceeding 2GB (FAT16) or 4GB (FAT32) and that includes any intermediate working files.

    3. Start simple, if your command doesn't work, trim it down to the absolute minimum till it does work, then build it back up until you see what is causing the problems, so I would recommend removing your -limit and your -define initially until it works and then add them back in, one at a time.

    Good luck.