画像を生成します。
-
python3
-
Pillow
yaki@niku $ pip install Pillowyaki@niku $ python flower_generator.py -h
usage: flower_generator.py [-h] [-o OUT] [-s SIZE] [-c R G B] [-n NUMBER]
[-t TYPE]
Generate flower image.
optional arguments:
-h, --help show this help message and exit
-o OUT, --out OUT output directory
-s SIZE, --size SIZE image width and height
-c R G B, --color R G B
color of petals
-n NUMBER, --number NUMBER
number of petals
-t TYPE, --type TYPE type of petal
yaki@niku $ python flower_generator.py -c 200 80 80 -n 8 -t 2
flowers/e57bcb23-56e7-4098-a419-cbdd84991ae5.png画像の生成に成功すると、標準出力にファイルの相対パスを出力して終了します。
--outオプションを指定しないと、flower_generator.pyのあるディレクトリのflowersディレクトリ下にファイルが保存されます。
--sizeオプションは画像の縦横のピクセル数です。例えば500を指定すると、500x500ピクセルの画像が生成されます。
-
花弁の色 (RGBが0~255)
-
花弁の数 (0~12)
-
花弁の種類 (0-6)
| type | 花弁 | 花弁画像 |
|---|---|---|
| 0 | 桜1 | ![]() |
| 1 | 桜2 | ![]() |
| 2 | エーデルワイス | ![]() |
| 3 | 稲妻 | ![]() |
| 4 | 焼肉 | ![]() |
| 5 | 魚 | ![]() |
| 6 | 昆布 | ![]() |






