Metadata-Version: 2.4
Name: charsplit
Version: 0.1.2
Summary: Split handwritten text images into individual characters with bounding box detection.
Author: Siddharth Karn
License: MIT
Project-URL: Homepage, https://github.com/devSiddharthKarn/charsplit
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# CharSplit

CharSplit is a lightweight, dependency-free Python library that segments a binary image into individual character images.

The input image is provided as a **2D matrix** (`list[list[float]]`), and the output is a list of extracted character images, where each character is represented as a `list[list[list[float]]]`.

[![PyPI version](https://img.shields.io/pypi/v/charsplit.svg)](https://pypi.org/project/charsplit/)
[![License](https://img.shields.io/pypi/l/charsplit.svg)](https://github.com/devSiddharthKarn/charsplit/blob/main/LICENSE)

## Features

- 🚀 Zero third-party dependencies
- ✂️ Segments a binary image into individual characters
- 📄 Accepts a 2D image matrix (`list[list[float]]`)
- 📦 Returns a list of character matrices (`list[list[list[float]]]`)
- ↔️ Preserves left-to-right character order
- 🐍 Pure Python implementation

## Installation

```bash
pip install charsplit
```

## Quick Start

```python
from charsplit.main import splitCharsFromImage

image = [
    [0, 0, 1, 1, 0],
    [0, 1, 1, 0, 0],
    ...
]

characters = splitCharsFromImage(image)

print(len(characters))
```

## API

### `splitCharsFromImage(image)`

Splits a binary image into individual character matrices.

#### Parameters

| Name | Type | Description |
|------|------|-------------|
| `image` | `list[list[float]]` | Input image represented as a 2D matrix |

#### Returns

```python
list[list[list[float]]]
```

A list of character images in left-to-right order.

## Applications

- OCR preprocessing
- Handwritten character segmentation
- Character dataset generation
- Machine learning preprocessing
- Computer vision pipelines

## Dependencies

None.

CharSplit is implemented entirely in pure Python and requires no external libraries.

## License

MIT License

## Author

**Siddharth Karna**
