I installed imagemagick
following instructions from Why is ImageMagick with OpenCL slower than OpenMP?. I need to resize an image to 4 different sizes and have to crop them. I wrote a C++ program that calls image.resize("500x500!")
, image.resize("550x550!")
, image.resize("600x600!")
, image.resize("650x650!")
, image.crop(Geometry(200,150, 10,50))
for 100 images in a folder.
When I run the same case in command line like this :
cd /home/Downloads/ImageMagick-6.9.3-7/utilities/ && \
exec sudo time ./convert img.jpg -write \
mpr:scroll -filter Lanczos -resize 500x500 -crop 200x150+10+50 -write m.jpg delete \
mpr:scroll -filter Lanczos -resize 600x600 -crop 200x150+10+50 -write n.jpg delete \
mpr:scroll -filter Lanczos -resize 550x550 -crop 200x150+10+50 -write o.jpg delete \
mpr:scroll -filter Lanczos -resize 650x650 -crop 200x150+10+50 p.jpg;
I got an output in 8124.13ms. But when I did the same case in Magick++ API, I got an output in 369237 ms. Why is there this much difference?
When I check the device benchmark file as this :
$ cat ~/.cache/ImageMagick/ImagemagickOpenCLDeviceProfile
it shows
<version>ImageMagick Device Selection v0.9</version>
<device><type></type><name>Quadro M6000</name><driver>352.79</driver><max cu>24</max cu><max clock>1114</max clock><score>0.0960</score></device>
<device><type></type><score>1.1890</score></device>
According to the post in How do I build ImageMagick with OpenCL?, the API has to run in GPU, because GPU device is having minimum score. How can I resolve it?