Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial (non-profit) 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

    Please read the Pointers For Use on my home page to properly install and customize my scripts.

FURROWED


Applies a furrowed-like effect to an image to enhance wrinkles creating a "gritty" look.

Download Script

last modified: December 15, 2018



USAGE: furrowed [-a amount] [-s smoothing] [-g gain ] [-b brightness ] [-S saturation ] infile outfile
USAGE: furrowed [-h or -help]

-a ... amount ....... amount of furrowing; float>=0; default=2
-s ... smoothing .... smoothing; float>=0; must be less than amount;
..................... default=0;
-g ... gain ......... gain; float>=0; default=10
-b ... brightness ... brightness; integer>=0; default=100 (no change)
-S ... saturation ... saturation; integer>=0; default=30

PURPOSE: To apply a furrowed-looking effect to an image creating a "gritty" look.

DESCRIPTION: FURROWED applies a furrowed-looking effect to an image to enhance wrinkles creating a "gritty" look.

ARGUMENTS:

-a amount ... AMOUNT of furrowing. Values are floats>=0. Amount must be larger than smoothing. The default=2.

-s smoothing ... SMOOTHING. Values are floats floats>=0; Smoothing must be less than amount. The default=0 (no smoothing).

-g gain ... GAIN. Values are floats>=0. The default=10.

-b brightness ... BRIGHTNESS. Values are integers>=0. The default=100 (no change).

-s saturation ... SATURATION. Values are integer>=0. A value of 100 is no change. The default=30.

REQUIREMENTS: IM 6.6.1.9 due to the use of -morphology DoG

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 1

Original
(source image)

Arguments:
(default)



Example 2 -- Variation in Amount

Original
(source image)

Arguments:
-a 1 -s 0

Arguments:
-a 2 -s 0
(default)

Arguments:
-a 3 -s 0



Example 3 -- Variation in Smoothness

Original
(source image)

Arguments:
-a 2 -s 0
(default)

Arguments:
-a 2 -s 1



Example 4 -- Variation in Gain

Original
(source image)

Arguments:
-a 2 -s 0 -g 5

Arguments:
-a 2 -s 0 -g 10
(default)

Arguments:
-a 2 -s 0 -g 20



Example 5 -- Variation in Saturation

Original
(source image)

Arguments:
-a 2 -s 0 -g 10 -S 30
(default)

Arguments:
-a 2 -s 0 -g 10 -S 50

Arguments:
-a 2 -s 0 -g 20 -S 100



What the script does is as follows:

  • Read the input image and applies a stretch to full dynamic range
  • Clone the previous result and converts to grayscale
  • Clone the new previous result and applies high pass filtering using DoG
  • Composites the input, high pass image and grayscale image together
  • Desaturate the composite and save output

This is equivalent to the following IM commands

  • convert "$infile" -auto-level \
    \( -clone 0 -colorspace gray \) \
    \( -clone 1 -bias 50% -define convolve:scale=$gain! \
    -morphology Convolve DoG:0,${smoothing},${amount} \) \
    +swap -compose overlay -composite \
    -modulate ${brightness},${saturation},100 \
    "$outfile"