Skip to content

Instantly share code, notes, and snippets.

@YuukiToriyama
Created April 9, 2019 04:21
Show Gist options
  • Save YuukiToriyama/6f3a2eb72cf704f8c4908fbb557fefde to your computer and use it in GitHub Desktop.
Save YuukiToriyama/6f3a2eb72cf704f8c4908fbb557fefde to your computer and use it in GitHub Desktop.
ImageMagickを使ってサイケ・アートをつくる
# convertコマンドのグラデーション機能の一つであるオペレーター「plasma」を使うとサイケデリックな画面を生成することができます。
# また、オプション「-swirl "角度"」を使うと画面をひん曲げることができます。
convert -size 500x500 -swirl 360 plasma:fractal clockwise.png
convert -size 500x500 -swirl -360 plasma:fractal anti-clockwise.png
# 時計回りに360度、半時計回りに360度変形させた2つの画像をcompositeコマンドを使って合成しています。それぞれの画像の差分を取って重ね合わせるため、-composeオプションにはdifferenceを指定しています。
composite -compose difference clockwise.png anti-clockwise.png output.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment