#+title: ImageMagick Snippets #+pubdate: <2020-08-03> *NB:* The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert" inspo sites: - http://www.fmwconcepts.com/imagemagick/index.php - http://im.snibgo.com/ ** Rotate a tiled image 45 degrees Better results with square images, of course. The ~45~ is the degree amount. #+begin_src sh magick in.png -matte -virtual-pixel tile +distort ScaleRotateTranslate '1 1 45' out.png #+end_src ** Stack images vertically #+begin_src sh magick 1.jpg 2.jpg 3.jpg -gravity center -append out.jpg #+end_src ** Create a solid color image #+begin_src sh magick -size 100x100 "xc:#cccccc" out.png #+end_src ** Rotate a tiled image an arbitrary degree see also: [[https://github.com/neeasade/dotfiles/blob/master/bin/bin/tiletilt][tiletilt]] #+begin_src sh tile="some_file.png" angle=$((RANDOM % 360)) w=1920 h=1080 magick "$tile" -set option:distort:viewport "${w}x${h}" \ -virtual-pixel tile -filter point \ -distort SRT "$angle" \ -gravity center -crop "${w}x${h}+0+0" +repage \ "result.png" #+end_src #+RESULTS: