Skip to content

Releases: DIM-Corp/i2g

i2g v0.1.0

16 Jul 19:31
Compare
Choose a tag to compare

🚀 i2g v0.1.0

✨ Features

Image to Graph Conversion

  • Convert any grayscale image to a networkx graph structure.
  • Each pixel becomes a node with:
    • intensity attribute (0-255)
    • pos attribute for easy plotting.

Connectivity Options

  • Supports 4-connectivity (N, S, E, W) and 8-connectivity (including diagonals).

Graph Info & Shape

  • Retrieve image shape as (height, width).
  • Retrieve number of nodes and edges.

Flexible Class Design

  • Use ImageGraphConverter to easily integrate into other pipelines.

🔧 Maintenance & CI

GitHub Actions CI

  • Automatically runs tests on pushes and pull requests.
  • Checks:
    • flake8 linting
    • black code style
    • pytest with coverage reporting.

Release Automation

  • Automatically builds and publishes to PyPI on tagged releases.

🐛 Fixes

  • Ensured newline at end of files to fix flake8 W292.
  • Reformatted code to comply with black line length (88 chars).

💥 Breaking Changes

  • None — first stable version.

📦 Install

pip install i2g

(or clone + pip install -e .[dev])


👀 Example Usage

from i2g import ImageGraphConverter

converter = ImageGraphConverter("my_image.png", connectivity="8")
graph, img_array = converter.convert()
shape = converter.shape()
nodes, edges = converter.info()

print(f"Graph shape: {shape}")
print(f"Nodes: {nodes}, Edges: {edges}")

❤️ Thanks

Thanks to all contributors and testers who helped validate this initial release.