Creative workflow

Reuse an SVG Crop With clipPathUnits

Two undulating ivory strata partly conceal a dark form and hold an amber glint

A crop for two fictional Pebble Studio previews needed to stay centered as their dimensions changed. One set of coordinates produced a fixed-radius circle. An object-relative crop followed each rectangle and appeared elliptical. We captured both Chromium renders in one Ciyo review board.

Quick answer

Choose objectBoundingBox when the clip should scale with the target’s width and height. Choose userSpaceOnUse when the center and radius need to stay in the current drawing coordinates.

Draw the target bounds

Start with two filled rectangles of different proportions. Show both boundaries behind the clipped areas so reviewers can see what disappeared. With userSpaceOnUse, this fixture uses a separate center for each shape and one 32-unit radius.

Production canvas at the start

The reference board shows two different rectangles with the same fixed-radius circular crop
Production canvas at the start

Define the crop in normalized coordinates

Set clipPathUnits='objectBoundingBox'. Center the circle at .5, .5 and use a radius of .36. The normalized x-axis scales by the target width and the y-axis by its height. The visible area is therefore elliptical on a non-square target.

Decide when you need a true circle

Use user-space coordinates with equal x and y scales for a literal circular crop. Derive the center from the intended box if it moves. If a normalized crop looks wrong on a long text-like rectangle, check whether a shape that follows the aspect ratio is appropriate.

Production canvas after the comparison

Production Ciyo compares fixed circles with two ellipses scaled to their different target rectangles
Production canvas after the comparison

Compare two substantially different aspect ratios

Import screenshots at equal scale and place the normalized result beside the fixed-radius one in Ciyo. Test a tall and wide target before reusing the crop. Avoid zero-width or zero-height target geometry when using objectBoundingBox.

Example files

Sources and related reading

Quick questions

Why does a normalized circle become an ellipse?

Normalized units transform independently along each axis. Different target widths and heights scale the same radius differently.

Do I need an alpha mask for a hard-edged crop?

A clip path can define a hard crop. Use a mask when you want gradual opacity or luminance to affect visibility.

Try it on your canvas

Keep the input and reviewed result on separate layers so you can revisit the decision before handing off the final file.