How to how the ramer–douglas–peucker algorithm simplifies svg paths
- Step 1Understand the recursive split — RDP works by: (1) connecting the start and end points of a segment with a line, (2) finding the point furthest from that line, (3) if it exceeds tolerance, keeping it and recursing. Otherwise, all intermediate points are removed.
- Step 2Choose tolerance based on error budget — Tolerance is in SVG user units (pixels at 1:1 scale). A tolerance of 1.0 means no removed point was further than 1px from the simplified path — invisible at typical display sizes.
- Step 3Apply to your SVG paths — The JAD Path Simplifier converts your SVG curves to polylines, runs RDP, and converts back. The visual difference at your chosen tolerance is shown in the side-by-side preview.
Frequently asked questions
How does RDP compare to the Visvalingam–Whyatt algorithm?+
Both simplify polylines. RDP measures perpendicular distance from a line, while Visvalingam measures triangle area. RDP is faster and better at preserving prominent features; Visvalingam produces smoother results at low tolerances.
What is the time complexity of RDP?+
O(n log n) in the average case, O(n²) worst case. In practice, for SVG paths with typical node counts (50–500 points per path), it's near-instant in a browser.
Can RDP handle closed paths?+
Yes. Closed paths (the Z command in SVG path data) are processed as a loop — the start and end are treated as the same point for the initial split step.
Does RDP work on gradient mesh or complex Illustrator paths?+
RDP simplifies control point positions. Complex fill styles (gradients, patterns) are preserved regardless of path simplification — only the shape outline changes.
Privacy first
Every JAD SVG tool runs entirely in your browser using the DOM API and Canvas. Your SVG files never leave your device — verified by zero outbound network requests during processing.