I have the following snippet in my bash script
#!/bin/bash
for ((i=100; i>=70; i--))
do
convert test.png -quality "$i" -sampling-factor 1x1 test_libjpeg_q"$i".jpg
done
How can i execute the for loop in parallel using all cpu cores.I have seen gnu parallel being used but here i need the output filename in a specific naming scheme as shown above
convert ..line into a separate shell script thatparallelcan call . Good luck.&to convert command.mogrifyand GNU Parallel's-Xoption because if you useconvert, you necessarily have to create a whole new process for every image. So if you have a large number of small images, the overhead is enormous. Say you have 80,000 images, you will be better off with 8mogrifyprocesses doing 10,000 images each, than 80,000convertprocesses doing 1 each.