Fred's ImageMagick Scripts



 

 

GLOW


Creates a glowing effect in an image.

Download Script

last modified: May 30, 2008



USAGE: glow [-a amount] [-s softening] infile outfile
USAGE: glow [-h or -help]

-a .... amount ......... glow amount; float; amount>=1; default=1.5
-s .... softening ...... softening; integer; soft>=0; default=0

PURPOSE: To create a glowing effect in an image.

DESCRIPTION: GLOW creates a glowing effect in an image by applying a gain factor (amount) and optionally a blurring (soft).

ARGUMENTS:

-a amount ... AMOUNT of glow expressed as a gain factor. Values floats greater than or equal to 1. A value of 1 produces no glow. Larger values increase the glow. Typical values are between 1 and 2. The default is 1.5.

-s softening ... SOFTENING creates a soft blurring effect to the glow. Values are integers greater than or equal to 0. A value of 0 produces no softening. Larger values increase the softening. Typical values are between 0 and 50. The default is 0.

CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk.


EXAMPLES


Image Glow
http://www.jhlabs.com/ip/blurring.html

Original

Arguments:
-a 1.3

Arguments:
-a 1.5

Arguments:
-a 1.7

Arguments:
-a 1.9



Image Glow With Softening
http://www.jhlabs.com/ip/blurring.html

Original

Arguments:
-a 1.7 -s 0

Arguments:
-a 1.7 -s 12

Arguments:
-a 1.7 -s 36

Arguments:
-a 1.7 -s 108



What the script does is as follows:

  • Applies a gain factor to the image and optionally blurs it
  • Adds that result to the original image

This is equivalent to the following IM commands

  • amount=`convert xc: -format "%[fx:$amount-1]" info:`
  • sigma=`convert xc: -format "%[fx:$soft/3]" info:`
  • convert $infile \( +clone -evaluate multiply $amount -blur 0x$sigma \) -compose plus -composite $outfile