Building a running bond tile in SVG
The pattern in question is a running bond: every row of bricks is offset by half a brick length, producing a staggered, repeating arrangement. SVG's <pattern> element maps onto this cleanly — it takes a pre-defined graphic and replicates it at fixed intervals along both axes, so the whole job reduces to defining one rectangular tile that is then repeated across the fill area.
Start with round dimensions: bricks at a width of 100 and a height of 30, with horizontal and vertical gaps of 10.

The base tile — a pattern tile, not a physical one — is two whole bricks in the top row and one whole brick flanked by two halves in the bottom row, with the gaps counted inside it. Those dimensions come from simple arithmetic:
Tile Width = 2(Brick Width) + 2(Gap) = 2(100) + 2(10) = 220
Tile Height = 2(Bright Height) + 2(Gap) = 2(30) + 2(10) = 80
That gives a tile of 220✕80. The pattern also needs patternUnits="userSpaceOnUse", which effectively means pixels, plus an id so other elements can reference it as a fill.
<pattern id="p" width="220" height="80" patternUnits="userSpaceOnUse">
<!-- pattern content here -->
</pattern>
Everything that follows is about writing that tile's contents in as few bytes as possible. The target:

Five rectangles, 197 bytes
The most declarative approach is five <rect> elements. SVG defaults to a black fill and a transparent stroke, so neither needs declaring. Only width and height are always required; x and y appear only when a brick is offset from zero.
<rect width="100" height="30"/>
<rect x="110" width="100" height="30"/>
<rect y="40" width="45" height="30"/>
<rect x="55" y="40" width="100" height="30"/>
<rect x="165" y="40" width="55" height="30"/>
In the top row the second brick sits at x="110", leaving 10 pixels of gap before it and 10 after (it ends at 210 while the pattern is 220 wide). That trailing space matters: without it the second brick would merge with the first brick of the adjacent tile. The bottom row's halves merge across tile boundaries with no gap, so their x values of 55 and 165 include half gaps.
Reuse via <use>: 154 bytes
Defining every brick explicitly is wasteful, and SVG's <use> element isn't widely known: it renders a referenced element wherever it appears. Widths and heights then only need stating once. The trade-off is an id on the reused element; one character is the minimum, so the brick is b. <use> takes x and y offsets just like <rect>.
<rect id="b" width="100" height="30"/>
<use href="#b" x="110"/>
<use href="#b" x="-55" y="40"/>
<use href="#b" x="55" y="40"/>
<use href="#b" x="165" y="40"/>
Because every brick is now full-width, the bottom row uses negative x values and lets the final brick overflow the tile; content outside the tile is clipped automatically, which keeps the seams clean.
Switching to paths: 100 bytes
<path> can describe any shape through commands in its d attribute. Of the 20 available commands, rectangles only need the simplest ones, and here is the result:
<path d="M0 0h100v30h-100z
M110 0h100v30h-100
M0 40h45v30h-45z
M55 40h100v30h-100z
M165 40h55v30h-55z"/>
The letters mean the following (line breaks and indentation above are purely for readability):
M{x} {y}moves to a point given by coordinates.zcloses the current segment.h{x}draws a horizontal line of lengthx, direction set by the sign; lowercase means a relative coordinate.v{y}draws a vertical line of lengthy, direction set by the sign; lowercase means a relative coordinate.
That halves the markup from the initial version.
A smaller tile: 62 bytes
The tile itself contains repetition. The top row clearly repeats a whole brick; in the bottom row it's less obvious until the middle brick is cut at its center. The cut isn't exactly at the halfway point — the gap shifts it slightly — but the resulting base tile is simpler and the pattern's width drops from 220 to 110.

<pattern id="p" width="110" height="80" patternUnits="userSpaceOnUse">
<!-- pattern content here -->
</pattern>
Redrawn with <path>, the tile looks like this:
<path d="M0 0h100v30h-100z
M0 40h45v30h-45z
M55 40h55v30h-55z"/>
At 62 bytes the pattern is already under a third of its original size.
Paths compress further: 53 bytes
Two <path> details help here. The first corrects a common intuition that a filled shape must be closed; per the specification:
The fill operation fills open subpaths by performing the fill operation as if an additional “closepath” command were added to the path to connect the last point of the subpath with the first point of the subpath.
So the z commands can go entirely. The second: lowercase commands use relative coordinates and uppercase use absolute ones, with single-coordinate semantics for the line commands:
H{x}draws a horizontal line from the current point to coordinatex.V{y}draws a vertical line from the current point to coordinatey.
Drawing the first brick starts at (0,0), runs horizontally to (100,0), vertically to (100,30), then back to (0,30). That last leg was written h-100, which is equivalent to H0 — two bytes instead of five. Applying this to two similar spots yields:
<path d="M0 0h100v30H0
M0 40h45v30H0
M55 40h55v30H55"/>
Bridging the moves: 48 bytes
The remaining bulk is the "move to" commands at 4, 5 and 6 bytes. One rule can't be avoided:
A path data segment (if there is one) must begin with a “moveto” command.
That's fine, since the first move is the cheapest. Swapping the rows makes it possible to move only horizontally or vertically between bricks — using h and v instead of M:

All three shapes are now a single path, and the fill operation closes the open span between (110,0) and (0,0). The rearrangement also moves the gap to the left of the full-width brick in the second row.
<path d="M0 0v30h50V0
h10v30h50
v10H10v30h100V0"/>
Trimming digits: 44 bytes
The last saving asks for a little flexibility in dimensions. A brick width of 100 costs three bytes; 90 costs two wherever it appears. Likewise a gap of 10 becomes 8, saving a byte per occurrence. The pattern dimensions shift to match:
<path d="M0 0v30h45V0
h8v30h45
v8H8v30h90V0"/>
The final code:
<pattern id="p" width="98" height="76" patternUnits="userSpaceOnUse">
<path d="M0 0v30h45V0h8v30h45v8H8v30h90V0"/>
</pattern>
Not counting indentation, the second line is 44 bytes — down from 197 across six iterations, a 77.7% reduction. Whether that is the true global minimum is an open question; further minification or alternative approaches may still push it lower.
Going further with SVG patterns
For related material, there is coverage of building patterns with SVG filters, a gallery of 60+ patterns in the PetitePatterns CodePen Collection, and a YouTube tutorial series on SVG patterns.



