This project is a Java application that implements the full eXtended Difference of Gaussians (XDoG) pipeline to produce stylized renderings of images. It converts input images into OKLab color space, computes structure tensors, applies directional blurs along edges, and then performs two LIC passes (thresholded and anti‑aliased). Results can be viewed in a simple Swing window and saved automatically.
This project can be a bit slow to render large images, since it runs entirely on the CPU and does not utilize parallel computing. While running the jar on the CMD it will display the time and memory each step takes.
Based on the work of: Holger Winnemöoller, Jan Eric Kyprianidis, Sven C. Olsen
- Full XDoG
- Converts images to OKLab color space (with optional dynamic range)
- Computes and smooths the structure tensor for edge orientation
- Applies directional blur orthogonal to edges at two scales
- Two LIC passes: one with threshold or quantization, one for anti‑aliasing
- Post‑Processing Modes
- None: raw output
- Threshold: hard‑clip plus smooth tanh transition
- Quantization: discrete tone levels
- Batch Processing & Saving
- Flags to skip display and auto‑save
- Run the
XDoG.jarexecutable - Choose the post‑processing mode: Threshold or Quantization
- Set the parameters:
sigmaCsigmaEsigmaMtauphisigmaAlevelsuseRange
- Drag & drop one or more images into the window
- Preview the result in real time before saving
- Save naming convention:
- Without threshold:
originalName_XDoG[type].png - With threshold (including range flag):
originalName_XDoG[type,boolean].png
- Without threshold:
-
Color Conversion & Range
- Convert ARGB pixels to normalized OKLab floats
- Optionally compute epsilon based on lightness distribution
-
Structure Tensor & Blur
- Compute per‑channel Sobel gradients, assemble tensor (E, F, G)
- Smooth with a Gaussian blur
-
Directional Blur
- Extract second eigenvector of the tensor at each pixel
- Blur along the orthogonal direction at two scales and subtract
-
Line Integral Convolution
- Pass 1: Convolve along the vector field, apply threshold or quantization
- Pass 2: Convolve again for anti‑aliasing
-
Reassembly & Saving
- Convert the final float array back to an ARGB image
- Display and/or save with a descriptive filename
By blending the XDoG output with the original image we can bring back colors.















