Jonathan King
Jonathan King

Reputation: 1

Imagemagick processing performance issue

Using Imagemagick 7 and have it installed on various Macs (imacs, macbook pro) sierra, high sierra, yosemite

I am trying to convert 300 plus multipage tiffs to single jpegs.

This is what I'm using

convert '*.*' /Users/ODI2/Desktop/JpegCopies/image-%d.jpeg

or

magick '*.*' /Users/ODI2/Desktop/JpegCopies/image-%d.jpeg

There seems to be a performance issue, sometimes I can convert up to 15 of the tiff documents, but only that many. Then sometimes the computers won't even do that. The file sizes are rough 1.5 to 3mb at max, 2500 x 4000px

So what can I do to be able to get this computers to process all these tiffs and jpegs? I can't seem to find a good answer on how to get the process to work right. This should be an extreme simply process for Imagemagick and the Macs.

Any help would be awesome!

Thanks so much!

Upvotes: 0

Views: 103

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207455

The problem is that you are trying to load hundreds of images at once.

Hopefully you installed ImageMagick with homebrew, which means you can install GNU Parallel with:

brew install parallel

Then make a backup and test with just a few copies of your files. GNU Parallel will run multiple convert jobs in parallel, one per CPU core, so if you have 4 CPU cores, it will keep 4 convert jobs running at a time till all 300 files are done. You can change that with parallel -j2 if you just want 2 at a time, for example.

So, you can hopefully do:

mkdir -p /Users/ODI2/Desktop/JpegCopies

parallel --bar --dry-run 'convert {} /Users/ODI2/Desktop/JpegCopies/{.}_%d.jpg' ::: *.tif

If that looks good, you can remove the --dry-run and do it again for real.

Upvotes: 1

Related Questions