ofnuts wrote:
Likely faster method with ImageMagick
here.
My experience has been that in the vast majority of cases, GIMP is faster.
GIMP does take longer to initially open, no doubt. On my test machine, just opening GIMP and immediately closing takes around 5 seconds. This was measured by running
time gimp -i -b '(gimp-quit 0)' . I did not measure the load time of ImageMagick but I presume it is rather negligible relative to the disk activity for the data files.
As to the basic processing done on the images (once loaded), I have not encountered any operations where ImageMagick is faster. GIMP seems to have the edge for common operations such color adjustments, blurring, and scaling. My experience with this is limited, but not as limited as one might think. My
RFX-GIMP project enables invoking GIMP scripts from the LiVES video editor and since LiVES employs ImageMagick for many of its video processing operations, I have been able to compare GIMP implementations for many of these operations. The difference has not been that great -- with GIMP performing either the same or up to twice as fast -- but I do not recall ImageMagick ever coming out ahead.
As an example, performing a rescale operation on an assortment of about two dozen images, GIMP took just over 8 seconds. ImageMagick handled this in 5 seconds. If you discount the initial load time for the GIMP program, GIMP would appear to be faster with regard to the actual processing. And for what it's worth, having an instance of GIMP already open dropped its execution time to 6 seconds -- a new GIMP process is still started for the batch run but it doesn't need to be loaded from disk because it already exists in memory
1.
Where GIMP really gains though is when the processing consists of multiple operations, because ImageMagick needs to reload and resave each image file for every operation; whereas with GIMP the image stays in memory during the whole process
1.
Going back to my example testing, adding a step to invert/negate the colors in each of my test files with GIMP had no significant effect on the processing time (1/10th of a second longer or so), whereas ImageMagick's benchmark increased to 10 seconds (double the initial processing time). As more steps are inserted into the processing pipeline, GIMP's advantage only increases.
I was actually a bit surprised by my experiences -- I would've thought that, were one to discount the issues of file loading and saving, ImageMagick should fair much better than GIMP. GIMP has never put an excessive amount of emphasis on optimizing for speed.
Nonetheless, I don't really care that much about the speed of GIMP's batch processing
1. What is important to me is that I know GIMP's capabilities and how to get things done with it. While ImageMagick has very thorough documentation, there is so much of it that I need to consult it even to do the most simple of tasks. Of course this situation would be improved if I used it more, but why bother when I can use GIMP, and generally speaking, GIMP is more featureful than ImageMagick (except for support of higher bit depths and some GIF colortable stuff).
1 With the way modern computers handle disk caching and process forking, benchmarking programs has become an extremely inexact science. Apart from avoiding any egregious mistakes in approach, I tend to just try to get things to work and move on. Especially for batch processing tasks, I rarely care whether it might take one hour or two, moreso if I have to expend much effort trying to save that extra time. I mainly posted this to provide a counterpoint to the conventional wisdom that ImageMagick is faster. Such has not been my experience. YMMV