0
0

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.

ImageMagickでホワイトノイズ画像を生成する

Last updated at Posted at 2019-04-10

ホワイトノイズ画像を生成する

convert -size 128x128 xc:gray +noise random -colorspace gray noise.jpg
  • 128x128 ここの数値を変更することで画像の大きさを指定できる
  • noise.jpg 出力する画像ファイル名。拡張子を変更することで出力するファイルの形式を指定できる。

大量のホワイトノイズ画像を生成する

10000の画像ファイル(noise0000.jpg 〜 noise9999.jpg)を生成するのには下記のシェルスクリプトを実行する。

# !/bin/bash
for i in `seq -f %04g 0 9999` ; do
    convert -size 128x128 xc:gray +noise random -colorspace gray noise${i}.jpg
done
  • seq -f %04g 0 9999 0000 〜 9999の4桁の数字を生成する。-f %04gの箇所で桁数を指定している。
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?