2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

定期的にランダムな背景色の画像をつくる

Posted at

定期的にランダムな背景色の画像を一定数つくりたかった。
ImageMagick と Zsh を使った。
ここでは 1.jpg - 10.jpg までの 10 枚の画像ファイルを 5 秒おきに作っている。

while true; do
    for x in {1..10}; do
        r=$(( RANDOM % 128 ))
        g=$(( RANDOM % 128 ))
        b=$(( RANDOM % 128 ))
        convert -size 160x120 xc:#`printf '%02x' $r``printf '%02x' $g``printf '%02x' $b` $x.jpg
    done
    sleep 5;
done
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?