Fred's ImageMagick Scripts


    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:

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


Applies a paint type effect to an image.

Download Script

last modified: December 15, 2018

USAGE: painteffect [-g gammaval] [-b blur] [-p paintval] [-e edgegain] [-t texturize] [-r reseed] [-s soften] [-m mix] infile outfile

USAGE: painteffect [-h or -help]

-g ... gammaval .... preprocessing gamma adjustment to the midtone
.................... brightness; float>=0; default=1 (no change)
-b ... blur ........ selective blur (sigma) amount to lessen detail;
.................... float>=0; default=2
-p ... paintval .... oil paint effect amount; integer>=0; default=0
-e ... edgegain .... edge effect gain; float>=0; default=8
-t ... texturize ... apply random textures to the image; yes or no;
.................... default=yes
-r ... reseed ...... random texture seeds for two types of texture;
.................... comma separate integer>0 pair; default is random seeds
-s ... soften ...... texture softening; float>0; default=2
-m ... mix ......... mix/blend two types of texture; 0<=integer<=100;
.................... default=80

PURPOSE: To apply a paint type effect to an image.

DESCRIPTION: PAINTEFFECT applies a paint type effect to an image. An oil paint like effect is optional. A texturizing effect is optional. An edge effect is optional.


-g gammaval ... GAMMAVAL is a preprocessing gamma adjustment to the midtone brightness. Best results occur when the image is not overly white. Values are floats>=0. The default=1 (no change).

-b blur ... BLUR is the selective blur (sigma) amount to lessen detail. Larger values smooth out image detail. Values are floats>=0. The default=2.

-p paintval ... PAINTVAL controls the amount of a paint effect. Value are integers>=0. The default=0.

-e edgegain ... EDGEGAIN is edge effect gain amount. Values are float>=0. The default=8.

-t texturize ... TEXTURIZE is a flag to apply random textures to the image. Choices are: yes (y) or no (n). The default=yes.

-r reseed ... RESEED is a pair of random texture seeds for two types of texture. Values are comma separate non-negative integer pairs. The default is completely random seed values.

-s soften ... SOFTEN controls the texture softening/smoothing. Values are floats>=0. The default=2.

-m mix ... MIX is the percent mix/blend of the two types of texture. Values are 0<=integers<=100. The default=80.

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.


Example 1



-e 2

-p 5 -e 0 -t no

-p 5 -e 2 -t no

-p 5 -e 2 -t yes

Example 2


-g 1 -e 2

-g 1 -e 8

-g 1 -p 5 -e 2

Example 3


-g 1

What the script does is as follows for border=black at the top/bottom edges:

  • Reads the input
  • Applies selective blur
  • Optionally applies -paint
  • Optionally applies two kinds of noise texturing
  • Optionally applies edges
  • Saves the output

This is equivalent to the following IM commands for the case of no texturing:

  • convert "$infile" -gamma $gammaval -selective-blur 0x${blur}+20% -paint $paintval \
    \( +clone -sharpen 0x2 -morphology edgein diamond:1 \
    -evaluate multiply $edgegain -colorspace gray -negate \) \
    -compose multiply -composite \