This is a recreation of the XDoG image stylization technique as described in the Winnemoller et. al's papers XDoG: Advanced Image Stylization with eXtended Difference-of-Gaussians (DOI: 10.1145/2024676.2024700) and XDoG: An eXtended difference-of-Gaussians compendium including advanced image stylization (DOI: 10.1016/j.cag.2012.03.004). The app uses Google's deeplearn.js library to perform fast, GPU-accelerated image processing in the browser.
Parameter guide
Sigma 1 and Sigma 2 control the strength of the two gaussian functions whose difference is used for edge detection. A lower Sigma 1 will create finer details (mimicking a detailed sketch), while a higher Sigma 1 will yield less detail. Where Sigma 2 is much higher than Sigma 1, the lines will be thicker and vica-versa. Sigma 2 should generally always be greater than Sigma 1.
Threshold defines the luminance threshold which used to binarize the image (convert to black & white) when you're not using XDoG mode. A lower threshold will mean more pixels become white, yielding a lighter image with thinner lines, and vica-versa. The threshold is quite sensitive, so images can quickly collapse to becoming white/very light or black/very dark.
Sharpen (p) controls the strength of the sharpening that's applied when using XDoG mode. Sharpening with a large p exaggerates both the black and white edges present in the result.
Phi (φ) controls the steepness of the soft thresholding that's applied when using XDoG mode. A larger phi will lead to a sharper black/white transitions in the image.
Epsilon (ε) controls the level above which the adjusted luminance values will become white. A higher epsilon will yield a darker image with greater regions of blackness, and vica-versa. A low epsilon more closely emulates the behaviour of DoG mode.
Author
© 2017 Alex Peattie / alexpeattie.com / @alexpeattie