Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should check if your ImageMagick installation comes with OpenCL support:</p> <pre><code>convert -list configure | grep FEATURES </code></pre> <p>If it does (like mine), you should see something like this:</p> <pre><code>FEATURES HDRI OpenCL </code></pre> <p>This command</p> <pre><code>convert -version </code></pre> <p>should also give info about supported features.</p> <p>If it doesn't you should look after getting the most recent version of ImageMagick that has OpenCL support compiled in. Or if you build the package yourself from the sources, make sure OpenCL is used.</p> <hr> <p><strong>Update:</strong></p> <p>Oh wait. There's another feature that could help you, called <em>OpenMP</em> (for <em>multi-processing</em>).</p> <p>When OpenMP is enabled, ImageMagick commands can execute in parallel on all the cores of your system. So if you have a quad-core system, and resize an image, the resizing happens on 4 cores (or even 8 if you have hyperthreading).</p> <p>You can now also use the builtin <code>-bench</code> option to make ImageMagick run a benchmark for your command. For example:</p> <pre><code>convert logo: -resize 500% -bench 10 logo.png Performance[1]: 10i 0.689ips 1.000e 14.420u 0:14.510 </code></pre> <p>This command with <code>-resize 500%</code> tells ImageMagick to run the <code>convert</code> command to scale the built-in IM <code>logo:</code> image by 500% in each direction. The <code>-bench 10</code> part tells it to run that same command 10 times in a loop and then print the performance results:</p> <ul> <li>Since I don't have OpenMP enabled, I had only 1 thread (<code>Performance[1]:</code>).</li> <li>It reports that it ran 10 iterations (<code>10i</code>).</li> <li>The speed was nearly 0.7 iterations per second (<code>0.689ips</code>).</li> <li>Total user-alotted time was 14.420 seconds.</li> </ul> <p>You should find out how your system is set up regarding resource limits with this command:</p> <pre> identify -list resource File Area Memory Map Disk Thread Time -------------------------------------------------------------------- 192 4.295GB 2GiB 4GiB unlimited 1 unlimited </pre> <p>You can see my current system's settings (defaults -- I didn't tweak them). Each of the keywords in the column headers you can use pimp your system. </p> <ul> <li>The <code>files</code> defines the max concurrently opened files which ImageMagick will use.</li> <li>The <code>memory</code>, <code>map</code>, <code>area</code> and <code>disk</code> resource limits are defined in Bytes. For <em>setting</em> them to different values you can use SI prefixes, .e.g 500MB).</li> </ul> <p>If I <strong><em>had</em></strong> OpenMP for ImageMagick on this system, I could run</p> <pre><code>convert -limit thread 2 </code></pre> <p>in order to enable 2 parallel threads, re-run the benchmark and see if it really makes a difference, and if so how much. The I could set the limit to 4 or even 8 and repeat the excercise....</p> <hr> <p><strong>Finally</strong>, you could experiment with the internal format of ImageMagick's pixel cache, called <code>MPC</code> (Magick Pixel Cache). Some people say that for large operations the performance improves here, but I have no personal experience with it.</p> <p>Convert your base picture to MPC first:</p> <pre><code>convert input.jpeg input.mpc </code></pre> <p>and only then run:</p> <pre><code>convert input.mpc [...your long-long-long list of crops...] </code></pre> <p>and see if this saves you significantly on time. </p> <p>Most likely you can use this MPC format even "inline" (using the special <code>mpr:</code> notation), similar to how you applied the trick of using the <code>mpr:</code> format (<em>memory program register</em>) that reads the image into a named memory register. But I've never tried this technique to a real world problem, so I can't say how it works out in real life.</p> <hr> <p><strong>Update 2:</strong></p> <p>One more idea:</p> <p>First check for your exact ImageMagick version: run <code>convert -version</code>. </p> <p>In case your ImageMagick has a <code>Q16</code> (or even <code>Q32</code> or <code>Q64</code>) in its version string (meaning, its internal processes consider all images to have 16bit channel depth, which requires double memory as compared to <code>Q8</code>) -- this is the default nowadays -- you could test what performance benefits you'll achieve by switching to a Q8-build. (You'll pay your performance wins with quality losses, and you'll have to check if you can live with it or not....)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload