Skip to content

Python package

ra.raster_to_vector

Trace an image into curves.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.RasterToVectorApi.

Functions

Function
create()Vectorizes the image at path and adds the traced curves to the document.

ra.raster_to_vector.create()

ra.raster_to_vector.create(path: str, threshold=None, ignore_area=None, corner_threshold=None, tolerance=None, target_width=None) -> List[str]

Vectorizes the image at path and adds the traced curves to the document. Returns the ids of the added curves. threshold 0..1 black/white cut (default 0.51). Lower keeps more dark detail, higher more of the image. ignore_area speckles up to this many pixels are dropped (default 2) corner_threshold Potrace alphamax: 0 = sharp polygons, higher = rounder (default 1.0) tolerance curve optimization tolerance (default 0.2) target_width if > 0, the result is uniformly scaled so its total width is exactly this many model units (e.g. fit a motif to 12 mm). 0 = the tool’s native sizing (1 unit per 50 image pixels).

ParameterType
pathstrrequired
thresholdfloatoptional — None = the tool default
ignore_areaintoptional — None = the tool default
corner_thresholdfloatoptional — None = the tool default
tolerancefloatoptional — None = the tool default
target_widthfloatoptional — None = the tool default