View source: R/render_alpha_outline.R
| fill_alpha_gaps | R Documentation |
Internal post-process for small distance-transform
quantization artifacts on outline edges. The algorithm first calls
find_border_alpha_gaps() to mark only low-alpha pixels connected to the
image exterior. It then scans horizontal, vertical, and diagonal directions.
For each gap width up to max_gap, offset_alpha() samples the alpha values
on opposite sides of each candidate gap. A candidate pixel is raised to the
weaker of the two neighboring alpha values, and only if that pixel was marked
as border-connected. This bridges edge notches while leaving enclosed
interior holes unchanged.
fill_alpha_gaps(alpha, max_gap = 1, alpha_threshold = 0.25)
alpha |
Numeric alpha matrix. |
max_gap |
Default |
alpha_threshold |
Default |
Numeric alpha matrix with eligible border gaps filled.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.