How to Fix SVG Pattern Tile Seams at the Edges
Find out why an SVG pattern breaks where its tiles meet. Wrap clipped artwork to the opposite edge and check the repaired repeat at two output sizes.
On this page
- Tell a clipped motif from a rendering seam
- Wrap the part that crosses the tile boundary
- Verify the fix at two output sizes
- FAQ
- Why does my SVG pattern clip artwork at the edge?
- Should I make the whole SVG pattern tile wider to hide a gap?
- What if the seam only appears at some zoom levels?
- Start with one clean motif
- Sources
If artwork gets clipped at one edge of an SVG pattern tile, copy the missing continuation to the opposite edge. Shift that copy by one full tile width for a left-to-right seam, or one full tile height for a top-to-bottom seam, measured in the motif’s coordinate system. If you see only a thin line that changes with zoom, check for a rendering seam before changing the artwork. W3C SVG 2 pattern definition
A pattern tile is the rectangle that the renderer repeats to fill a shape. SVG patterns clip content to the tile by default. A path that extends past the right edge still stops at that edge, even if you gave the path an endpoint outside the tile.
Tell a clipped motif from a rendering seam
Put the pattern on a contrasting background and look across several repeats at the delivery size. The color showing through helps locate where paint is missing.
| What you see | What to inspect | What to change |
|---|---|---|
| The same visible piece is missing at each repeat | The motif crosses a tile edge and has no continuation across the boundary. | Duplicate the crossing geometry, shifted by a full tile width or height. |
| A fine seam changes as you zoom or export at a different size | Adjacent painted edges land on fractional pixels or the renderer resamples the tiles. | Check the target size and renderer before moving paths. |
| The whole repeat is spaced or scaled differently than expected | The tile bounds or the motif's coordinate system changed. | Inspect patternUnits, patternContentUnits, and any pattern viewBox. |
For thin lines between individual paths, see how to diagnose SVG gaps between shapes. The example below has a repeated missing segment because the path crosses the tile edge.
Wrap the part that crosses the tile boundary
Save this example as tile-seam.svg. The first row uses a diagonal line that runs from x = 8 to x = 56 in a tile that is only 48 units wide. The line extends eight units beyond the right edge. The repaired pattern repeats the full line 48 units to the left, so its last eight units appear at the start of each tile.
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="112" viewBox="0 0 192 112">
<defs>
<pattern id="clipped" width="48" height="48" patternUnits="userSpaceOnUse">
<path d="M8 30L56 14" fill="none" stroke="#176f64" stroke-width="6"/>
</pattern>
<pattern id="wrapped" width="48" height="48" patternUnits="userSpaceOnUse">
<path d="M8 30L56 14 M-40 30L8 14" fill="none" stroke="#176f64" stroke-width="6"/>
</pattern>
</defs>
<g>
<rect width="192" height="48" fill="#f6d6bf"/>
<rect width="192" height="48" fill="url(#clipped)"/>
</g>
<g transform="translate(0 64)">
<rect width="192" height="48" fill="#f6d6bf"/>
<rect width="192" height="48" fill="url(#wrapped)"/>
</g>
</svg>In the repaired path, M-40 30L8 14 is the first segment shifted left by 48 units. It lets the line resume at the same height in the next tile. Keep the original segment too. For a motif that crosses a corner, check both axes and the diagonally adjacent corner.
In this example, the tile and the path use the same user units. If a square 48-unit tile has a viewBox="0 0 24 24", one tile width is 24 units in the path data. Shift the motif by 24 there. If your SVG uses a different aspect ratio or alignment, check the mapped tile span in the motif’s coordinates first. SVG 2 pattern coordinates

Verify the fix at two output sizes
In our resvg renders at 192 and 193 pixels wide, the sample just to the right of the first tile boundary changed from the peach background to the green stroke after wrapping. The narrow size change preserves the underlying diagnosis in this example. Reopen your repaired file at the intended output size and inspect several horizontal and vertical joins.
If the motif shifted after scaling or rotating the artwork, check how SVG pattern units set the tile size and how patternTransform moves the paint. Fix the tile in its own coordinate system first. SVG 2 coordinate systems and units A renderer-specific hairline can still require a separate check, especially if the gap shows up only in one viewer or at one zoom level. The example tests a missing wrap, which is visible even at the original pixel size. SVG 2 rendering hints
FAQ
Why does my SVG pattern clip artwork at the edge?
SVG patterns normally clip their content to the tile bounds. If a line or shape extends past an edge, shift a copy by one tile width or height to bring the missing part back at the opposite edge. Measure that span in the motif’s coordinate system, especially if the pattern has a viewBox.
Should I make the whole SVG pattern tile wider to hide a gap?
A wider tile changes the repeat spacing. If the intended spacing is already right, use the existing width mapped into the motif coordinates to wrap the missing part.
What if the seam only appears at some zoom levels?
Compare the native and resized output before editing. A thin line that changes with zoom can be related to pixel alignment or resampling. A clipped motif repeats the same missing geometry at each tile boundary.
Start with one clean motif
PerfectVector can trace flat raster artwork into editable SVG paths. You can use one of those paths as the motif inside an SVG pattern.
If your source is a PNG or JPG, trace one motif into vector paths, then inspect its silhouette and any holes. Set the tile dimensions and edge continuations in the SVG after you have a motif you want to repeat.
Sources
- W3C SVG 2 — The pattern element — Defines repeated tiles, their dimensions, and default clipping.
- W3C SVG 2 — Coordinate systems and units — Defines how a bounding box can supply a coordinate system for SVG paint.
- W3C SVG 2 — Rendering hints — Describes trade-offs a renderer may make when painting shape edges.
More from the blog
Half-Drop vs Straight Repeat: Place the Same Motif
Compare straight, half-drop and half-brick layouts using one original motif. Check the translations, rectangular repeat cells and matching edge fragments.
SVG shape-rendering crispEdges: When Does It Help?
See when SVG crispEdges helps pixel-grid marks, when it can roughen curves, and why a browser test at two sizes beats treating the rendering hint as a fix.


