Smoothing Mesh Gradients
Coons patch mesh gradients suffer from one flaw: the derivative of the color profile can have jumps at patch boundaries. This can lead to visable artifacts like bright lines at patch boundaries and "star" patterns centered at patch corners. These artifacts are enhanced by the effect of Mach Banding
Adobe Illustrator and CorelDraw implement smoothing in their meshes to ensure the derivatives are continuous. I propose that SVG have the option to "auto" smooth colors across patch boundaries.
The proposed method is to use bicubic interpolation for each color component (RGB). The tangent values are limited to maintain monotonic color profiles along patch boundaries and to ensure minima and maxima remain along patch boundaries. For the edge patches the tangents perpindicular to the edge at the edge are determined by requiring the profile to be quadratic. This (appears) to reproduce Illustrator behavior.
- No smoothing.
- Hermite with tangents flat.
- Catmul-Rom smoothing. Double end point.
- Catmul-Rom smoothing. Reflect around end point.
- Catmul-Rom smoothing. Quadratic end patches.
- Catmul-Rom smoothing with tangent limited to prevent overflow.