Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial use, ONLY.

    For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net.

    If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment.

    Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php

LUCISARTEFFECT


Applies a LucisArt-like effect to an image.

Download Script

last modified: April 25, 2015



USAGE: lucisarteffect [-g gain] [-s saturation] infile outfile
USAGE: lucisarteffect [-h or -help]

-g ... gain ......... effect gain; float>=0; default=0.3
-s ... saturation ... saturation of cartoon; integer>=0; default=60

PURPOSE: To apply a LucisArt-like effect to an image.

DESCRIPTION: LUCISARTEFFECT applies a LucisArt-like effect to an image..

ARGUMENTS:

-g gain ... gain of the effect. Values are floats>=0. The default=0.3.

-s saturation ... SATURATION for the effect. Values are integer>=0. The default=60.

Reference: http://www.lucisart.com/

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


Example - Variation Of Parameters

Original Image
(source)

 

Arguments:
-g 0.3 -s 60
(defaults)

 

Arguments:
-g 1 -s 60

 

Arguments:
-g 1 -s 100


What the script does is as follows:

  • read the input image to tempary mpc format
  • clone the image and apply a DoG filter
  • screen composite the DoG and original images
  • clone the original image again, totally desaturate it,
    and apply 6 pixel blur to grayscale
  • overlay composite the blurred and desaturated image
    with the previous composite
  • apply unsharpening with the mixing factor as gain
  • write the result as output

This is equivalent to the following IM commands

  • convert -quiet -regard-warnings "$infile" +repage "$tmpA1"
  • convert $tmpA1 \
    \( -clone 0 -define convolve:scale=1 -morphology Convolve DoG:0,0,2 \) \
    -compose screen -composite \
    \( -clone 0 -modulate 100,0,100 -negate $blurring \) \
    -compose overlay -composite \
    -unsharp 0x9+${gain}+0 \
    -define modulate:colorspace=HCL -modulate 100,$saturation,100 \
    $outfile