Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Combine Images

In this example we take two images from the internet, generate an arrow image and then combine all three into one image with an arrow between. Various resizing and border placement is done to improve the aesthetics.

$ wget -O img1.jpg \
  https://www.goodfreephotos.com/cache/australia/south-australia/adelaide/\
adelaide-northern-terrace-in-1839-southern-australia.jpg

$ wget -O img2.jpg \
  https://www.goodfreephotos.com/albums/australia/south-australia/adelaide/\
north-terrace-of-adelaide-in-1841-in-southern-australia.jpg

$ arrow_head="l -15,-5  +5,+5  -5,+5  +15,-5 z"
$ convert -size 100x30 xc: -draw 'stroke skyblue fill skyblue rectangle 30,14 70,16' \
          -draw "stroke skyblue fill skyblue path 'M 70,15  $arrow_head' " \
	  -resize 400% arrow.png

$ convert img1.jpg arrow.png img2.jpg -gravity Center +append \
          -resize 30% -bordercolor White -border 10x10 result.png
$ display result.png

Figure 33.5: Using imagemagick to append multiple images, including an imagemagick generated arrow, into a single image.
Image imagemagick_append

The images used here come from https://www.goodfreephotos.comand is under the CC0 / Public Domain license.


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. Creative Commons ShareAlike V4.