投影随机图像/蒙太奇

时间:2019-06-10 10:37:34

标签: shell imagemagick raspberry-pi3

我正在安装一个从大型文件夹(超过50,000 jpeg不同大小)中投影所选随机图像的安装。

我已经在这里发布并获得了有关此方面的帮助: Shell script to open random jpegs with ImageMagick

#!/bin/bash
# Get list of files into array - just once at start
files=(*.jpg)

# Do forever
first=0
while :; do
   # Shuffle array
   files=( $(shuf -e "${files[@]}") )

   # Make montage of first 5 images in shuffled array
   montage -background '#000000' ${files[0]} ${files[1]}  ${files[2]} ${files[3]} ${files[4]} ${files[5]} ${files[6]} mon$

   # Start displaying if first pass - leaving "display" running in background updating itself every second
   if [ $first -eq 0 ] ; then
      display -update 1  montage.jpg &
      first=1
   fi

   # Snooze 10 and repeat
   sleep 1
done

对于每次迭代,我希望选择并投影随机数量的图像(例如1-10张图像之间)。

我希望此蒙太奇全屏显示-这样就没有窗口或显示任何东西,只是蒙太奇具有x数量的图像。

我的问题是:

如何从文件夹中选择随机数量的图像(1-10)来创建montage.jpg

如何将蒙太奇jpeg加载为全屏显示?

0 个答案:

没有答案