Adding drop shadow to your screenshots is great, specially if you're going to use those screenshots in your website, blogs or any other creative place. Drop shadow makes the images more beautiful and helps to enhance content. Here is an example:

Image without drop shadow

Image with drop shadow

If you're running MacOS, by default, all your screenshots will have drop shadow. But, if you're on Windows or Linux, then your screenshots won't have drop shadow by default. But that doesn't mean you can't have them. With a tool called "imagemagic" and a simple Bash Script, you can add drop shadow to your Windows or Linux screenshots as well.

This method requires the Bash Shell, so if you are using Windows, make sure you enable WSL (Windows Subsystem for Linux). If you need help on how to enable and use WSL, you can check out my blog on the same HERE

STEP 1: Install ImageMagic

Open your terminal (which uses a Bash Shell) and type the command: sudo apt install imagemagick


STEP 2: Make a Bash Script

  • Navigate to any desired folder and type the command: touch Add_Shadow.sh. This creates an empty file named "Add_Shadow.sh.
  • Run nano Add_Shadow.sh and paste the following code.
  • #!/bin/bash
    
    convert "$1" \( +clone -background black -shadow 57x15+0+13 \) +swap -background transparent -layers merge +repage "$1"

STEP 3: Add an Alias in your .bashrc config file

If you are using Bash, run nano ~/.bashrc and add the following line at the end.
alias shadow='bash ~/[Path to the Script]/Add_Shadow.sh'
If you are using ZSH, run nano ~/.zshrc and add the following line at the end.
alias shadow='zsh ~/[Path to the Script]/Add_Shadow.sh'

STEP 4: Usage Instructions

Syntax: shadow [Path/]Filename.png

Suppose you have an image named "myImage.png" in a folder named "Pictures". Then to add drop shadow to that image run the command: shadow Pictures/myImage.png

If, suppose, you're a Windows user and you have an image named "profile.png" in a folder named "MyImages" inside your D: drive, then you can use the command: shadow /mnt/d/MyImages/profile.png

HAVE FUN :)