ImageMagick convert and GNU parallel together

回眸只為那壹抹淺笑 提交于 2019-12-03 16:14:40

If downsizing is an option, yes, you can readily do that with GNU Parallel

parallel -j 8 convert {} -resize ... {} ::: *.png

where {} stands for the filename, and the files to be processed are listed after the :::.

-j gives the number of jobs to run in parallel.

I just created 100 PNGs of 10,000 x 8,000 and resized them to 2,000 x 1,200 sequentially in 8 minutes using

#!/bin/bash
for f in *.png; do
    convert $f -resize 2000x1200! $f
done

then, the same original images again, but with GNU Parallel

parallel convert {} -resize 2000x1200! {} ::: *.png

and it took 3 minutes 40 seconds. Subsequently making those 100 PNGs into a movie took 52 seconds.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!