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. |
Applies a cartoon-like effect to an image. |
last modified: December 16, 2018
USAGE: toonify [-b blur] [-t threshold] [-e edge] [-g gain] [-l lothresh]
[-h hithresh] [-q quantize] [-s smoothing] [-B brightness] [-C contrast]
[-S saturation] infile outfile
-b ... blur ......... blur sigma for selective-blur; integer>=0; default=4 PURPOSE: To apply a cartoon-like effect to an image. DESCRIPTION: TOONIFY applies a cartoon-like effect to an image. Edges and color quantization are optional. There are several choices for the edge method. ARGUMENTS: -b blur ... BLUR sigma for selective-blur. Values are integers>=0. The default=4. -t threshold ... THRESHOLD for selective-blur. Values are 0<=integers<=100. The default=10. -e edge ... EDGE method. The choices are: none (n), sobel (s), DoG (d) (for difference of gaussians), LoG (l) (for log of gaussian) and canny (c). The default=sobel. -g gain ... GAIN for edge strength. Values are integers>=0. The default is automatically computed for different edge methods. For DoG it is 20. For LoG it is 15. For sobel it is 4. This option is not used for canny. -l lothresh ... LOTHRESH is the low threshold for the canny edge method. Values are integers>=0. The default=5. -h hithresh ... HITHRESH is the high threshold for the canny edge method. Values are integers>=0. The default=20. -q quantize ... QUANTIZE is the quantization number of color levels. Values are 0<=integers<=255. A value of zero means no quantization. The default=8. -s smoothing ... SMOOTHING of the quantization color boundaries. Values are floats>=0. The default=1. -B brightness ... BRIGHTNESS change. Value are integers. The default=0. -C contrast ... CONTRAST change. Values are integers. The default=0. -S saturation ... SATURATION increase. Values are 0<=integer<=49. The default=0. REFERENCES: http://www.cs.cornell.edu/courses/cs4670/2010fa/projects/final/results/group_of_pw272_zkd2/ComputerVisionFinalReport/ComputerVisionFinalWriteup.pdf https://stacks.stanford.edu/file/druid:yt916dh6570/Dade_Toonify.pdf 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 -- Variation in Blur |
||
Original |
||
Arguments: |
Arguments: |
Arguments: |
Example 2 -- Variation in Threshold |
||
Original |
||
Arguments: |
Arguments: |
Arguments: |
Example 3 -- Variation in Edge |
|
Original |
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Example 4 -- Variation in Edge with Quantization |
|
Original |
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Example 5 -- Variation in Edge with Quantization |
|
Original |
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Example 6 |
|
Original |
Arguments: |
Example 7 |
|
Original |
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands
|