Measure the Repeat in a Transparent SVG Dot Tile
Admin ·
Use dots to check a tile’s geometry without relying on its appearance alone. Measure the centers of two repeats and compare the same foreground in the editable SVG, PNG and CSS background.
Measure the first two dot centers
Load Coastal dots and leave Mark size at 4 px. Set Tile side to 32 px, Tile gap to 8 px, and offsets to 5 px horizontal and 7 px vertical. Keep Rotation at 0°.
The first center is 16 px into the 32 px motif from the offset. That puts it at 21, 23 px. The next center sits at 61, 23 px. The difference is 40 px, matching the motif plus the gap.
| Measurement | Value |
|---|---|
| Tile pitch | 40 px |
| First center | 21, 23 px |
| Second center | 61, 23 px |
| Canvas | 240 × 160 px |
Reopen the SVG and PNG with transparency
Check Transparent background and enter rgba(40, 78, 98, .5) for Foreground color. Choose Standalone SVG and download it. Its pattern x and y are 5 and 7, while pattern width and height are both 40. The circle inside the tile still has a 4 px radius.
Download PNG and open it with transparency enabled. The dot centers are half opaque. The 8 px gap reveals the editor’s background. Verify that Image width and Image height remain 240 and 160 px.
SVG 2 pattern paint servers and tile boundsPortable Network Graphics Third Edition alpha support
Reuse the repeated motif in CSS or a drawing
Choose CSS background and apply vector-pattern to a box. The embedded SVG uses the box as its viewport, so enlarging the box reveals more repeats. Test the result on the background and dimensions you plan to use.
Choose SVG pattern definition if you want to paste the pattern into another drawing’s defs. Keep its ID unique in that document, then point your shape’s fill to that ID. Set Rotation to turn the complete grid around the origin.
SVG 2 pattern paint servers and tile boundsCSS Backgrounds and Borders Level 3 image sizing
Common questions
Does increasing the canvas width change the dot spacing?
The drawing viewport grows, and the pattern continues at the same user-space tile pitch. Changing tile side or gap adjusts the spacing.
What changes if I select a background color with alpha?
The drawing includes a translucent background layer. Transparent background removes that layer so uncovered areas have zero alpha.