Socket
Socket
Sign inDemoInstall

pyautotrace

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pyautotrace

Python bindings for AutoTrace.


Maintainers
1

Readme

PyAutoTrace

Python bindings for AutoTrace.

Requirements

  • Python 3.8 or higher

Installation

python -m pip install pyautotrace

Usage

import numpy as np
from autotrace import Bitmap, VectorFormat
from PIL import Image

# Load an image.
image = np.asarray(Image.open("image.jpeg").convert("RGB"))

# Create a bitmap.
bitmap = Bitmap(image)

# Trace the bitmap.
vector = bitmap.trace()

# Save the vector as an SVG.
vector.save("image.svg")

# Get an SVG as a byte string.
svg = vector.encode(VectorFormat.SVG)

Building

If you wish to build the package from source, clone the repository and follow the instructions for your platform below.

Linux and MacOS

sh ./scripts/build_unix.sh

A virtual environment will be created using your default Python installation. Compilation requires GLib, pkg-config, and unzip to be installed on your system, which most Linux distributions include by default. On MacOS you can install GLib with brew install glib.

Windows

.\scripts\build_windows.ps1

A virtual environment will be created using your default Python installation. In order to compile the generated C code, you will need to have Visual C++ Build Tools or another C/C++ compiler installed.

TODO

  • Tests
  • Documentation

License

MIT License

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc