BACK TO THE HOMEPAGE

May 02, 2021 1 min read

Imagemagick Shadow

A quick tutorial on using Imagemagick to add a background shadow to images. For the best result, ensure the original image has a transparent background. It is also useful to observe consistent sizes for the images.

Add a shadow

  1. Set the name of the input image - for example
input="old.png"
  1. Set the name of the output image - for example
output="new.png"
  1. Use the input image and create the output image with a shadow
convert -page +4+4 $input -alpha set \( +clone -background navy -shadow 60x8+8+8 \) +swap -background none -mosaic $output