{"id":22967,"library":"vtracer","title":"vtracer","description":"Python bindings for the Rust Vtracer raster-to-vector library. Converts bitmap images (PNG, JPG, etc.) to SVG vector graphics with configurable color precision, gradient steps, and hierarchical clustering. Current version 0.6.15, requires Python >=3.7. Active development but infrequent releases.","status":"active","version":"0.6.15","language":"python","source_language":"en","source_url":"https://github.com/vislyhq/vtracer","tags":["raster-to-vector","svg","image-tracing","vectorization","vtracer"],"install":[{"cmd":"pip install vtracer","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used internally for image processing, installed automatically.","package":"numpy","optional":false},{"reason":"Used for reading image files (JPEG, PNG etc.), installed automatically.","package":"pillow","optional":false}],"imports":[{"note":"The function is at module top level, not a submodule.","wrong":"import vtracer; vtracer.convert_image_to_svg_path","symbol":"convert_image_to_svg_path","correct":"from vtracer import convert_image_to_svg_path"},{"note":"Alternative function that accepts similar parameters.","symbol":"convert_image_to_svg","correct":"from vtracer import convert_image_to_svg"}],"quickstart":{"code":"from vtracer import convert_image_to_svg_path\n\n# Convert a PNG to SVG with default settings\ninput_path = 'input.png'\noutput_path = 'output.svg'\nconvert_image_to_svg_path(\n    input_path,\n    output_path,\n    colormode='color',         # 'color' or 'binary'\n    hierarchical='stacked',    # 'stacked' or 'cutout'\n    mode='spline',             # 'spline' or 'polygon'\n    filter_speckle=4,          # Remove speckles smaller than this\n    color_precision=6,         # Color quantization bits (0-8)\n    layer_difference=16,       # Merge layers if color diff ≤ this\n    corner_threshold=60,       # Corner detection angle threshold\n    length_threshold=4.0,      # Curve approximation threshold\n    max_iterations=10,         # Max iterations per path\n    splice_threshold=45,       # Splice detection angle\n    path_precision=3           # Path simplification (0=lossless, 3=high quality)\n)\nprint(f'Converted {input_path} to {output_path}')","lang":"python","description":"Converts a raster image to SVG with customizable vectorization parameters."},"warnings":[{"fix":"Ensure input is grayscale when using colormode='binary', or convert to grayscale first with Pillow.","message":"colormode='binary' expects a grayscale image; color images will produce unexpected results. Use colormode='color' for color images.","severity":"gotcha","affected_versions":"all"},{"fix":"Use hierarchical parameters (layer_difference) to control noise in color mode.","message":"The filter_speckle parameter only applies to binary mode. In color mode it is ignored.","severity":"gotcha","affected_versions":"all"},{"fix":"Update imports to use 'convert_image_to_svg_path' or 'convert_image_to_svg' and adjust parameters per current docs.","message":"Before 0.5.0, the function was named 'convert_image' and had a different parameter set. The API was completely rewritten for 0.6.x.","severity":"breaking","affected_versions":"<0.5.0"},{"fix":"Install Rust via rustup if building from source fails. Alternatively, use a supported platform or check for prebuilt wheels on PyPI.","message":"The library is a Python binding to a Rust binary; the Rust binary must be compatible with the Python wheel. Some platforms (e.g., ARM64 Linux) may not have precompiled wheels and will build from source via maturin, which requires Rust toolchain.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install vtracer'. Ensure you are using the correct Python environment.","cause":"The package is not installed or installed incorrectly.","error":"ModuleNotFoundError: No module named 'vtracer'"},{"fix":"Provide both input_path and output_path as positional arguments.","cause":"The function signature changed; output_path is now required.","error":"vtracer.convert_image_to_svg_path() missing 1 required positional argument: 'output_path'"},{"fix":"Double-check the file path; use os.path.exists() to verify.","cause":"The input file path is incorrect or file does not exist.","error":"OSError: [Errno 2] No such file or directory: 'input.png'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}