Img2Num Python Bindings (Internal Developer Docs) dev
API Documentation
Loading...
Searching...
No Matches
Img2Num Python Bindings

Introduction

The Img2Num Python Bindings provide a Python interface to the core Img2Num image processing library via pybind11 (also see their docs). These bindings wrap the underlying C++ functionality, exposing image processing operations such as filtering, clustering, thresholding, and SVG conversion to Python code.

All functions operate on numpy.ndarray buffers and return new image data, making them easy to integrate into Python-based image processing pipelines.

Key Features

The Python bindings expose the following core capabilities:

  • FFT-based Gaussian blur — Fast frequency-domain blurring
  • Image inversion — Invert pixel values
  • Thresholding — Standard and black-thresholding operations
  • K-means clustering — Pixel clustering for color quantization
  • Bilateral filtering — Edge-preserving smoothing
  • Label-to-SVG conversion — Convert labeled images to SVG strings
  • Image-to-SVG conversion — Full image vectorization with configurable parameters
  • ImageToSvgConfig — Python-accessible configuration for SVG generation

Building the Python Bindings

The Python bindings are built using CMake from the project root:

cmake -B build .
cmake --build build

Installation

Install the bindings to your system:

cmake --install build

The compiled img2num module will be available for import in Python:

import img2num

Usage Example

API Reference

Browse the detailed function and class documentation: