Simple image processing script to apply a higurashi background style filter to an image.
Based on rwbyrocks higurashify.
We cut apply a preprocessing step for resizing and/or cropping the image, and then we pass it through a pipeline with 5 steps (every step can be optional).
In order:
When provided a white contrast level percentage
Then for each RGB channel
We apply an unsharpening mask using a 1D box blur with radius
When provided a sharpening amount percentage
We copy the main image and apply a directional box blur. The user provides as arguments the blur
direction angle
For each pixel
Then we alpha blend the blurred result over the image; for each RGB channel
We apply a simple color quantization over every pixel. The user provides the quantization level
Then for each RGB channel
First, we generate a grayscale image from the original unprocessed pixels. For each RGB value in each pixel in the image:
We apply an edge detection kernel over the grayscale image, any of the following:
- Sobel
- Laplacian
- Roberts
- Prewitt
The user provides a max threshold value
Finally we multiply blend the edge mask with the image, the user defines the edge opacity percentage
Parameters:
- aspect:
original - max-height:
1080 - contrast-level:
85.0 - blur-angle:
-25.0 - blur-opacity:
0.8 - blur-radius:
9 - edge-method
sobel - edge-threshold:
80.0 - edge-opacity:
0.5 - unsharpening:
1.0 - quantization:
9

