Metadata-Version: 2.4
Name: netra-cv
Version: 0.1.0
Summary: Netra: Mata Digital untuk Pemrosesan Citra Nusantara
Author-email: Netra Contributors <muhammadikhwanfathulloh17@gmail.com>
Project-URL: Homepage, https://github.com/Muhammad-Ikhwan-Fathulloh/Netra-CV
Project-URL: Bug Tracker, https://github.com/Muhammad-Ikhwan-Fathulloh/Netra-CV/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python>=4.5.0
Requires-Dist: numpy>=1.19.0
Requires-Dist: pillow>=8.0.0
Dynamic: license-file

# Netra: Digital Eye for Image Processing

[Bahasa Indonesia](README_ID.md)

[![PyPI version](https://img.shields.io/pypi/v/netra.svg)](https://pypi.org/project/netra/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Netra** (Sanskrit/Javanese: "Eye") is a modern Python library designed to simplify image processing and computer vision. Inspired by the philosophy of **Saka-NLP**, Netra serves as a clean, modular, and high-performance visual infrastructure pillar.

---

## ✨ Key Features

*   **Clean API (Façade Pattern)**: Access all advanced features through a single `Netra` class.
*   **Intelligent Auto-Correction**: Automatically straightens skewed images with `auto_rotate`.
*   **One-Line Preprocessing**: Clean images for OCR or Deep Learning in a single line.
*   **Smart Resizing**: Resize images without breaking the aspect ratio.
*   **Data Augmentation**: Includes noise injection and lighting simulation for AI datasets.
*   **Computer Vision Plugins**: Built-in support for face detection, shape detection, and color isolation.
*   **Lightweight Algorithms**: Includes Pencil Sketch, Cartoon, Sepia, and Contrast Enhancement.

---

## 🚀 Installation Guide

Ensure you have **Python 3.8 or newer**.

```bash
pip install netra-cv
```

For installation from source (development version):

```bash
git clone https://github.com/Muhammad-Ikhwan-Fathulloh/Netra-CV.git
cd Netra-CV
pip install -e .
```

---

## 📖 Usage Examples

Netra is designed to keep your code clean and readable.

### 1. Basics & Preprocessing
```python
from netra import Netra

# Load image
img = Netra.load("photo.jpg")

# Clean image (Grayscale -> Blur -> Otsu Threshold)
cleaned = Netra.clean_image(img)

# Automatically straighten image skew
straightened = Netra.auto_rotate(img)
```

### 2. Geometric Manipulation
```python
# Smart resize (preserving aspect ratio)
resized = Netra.smart_resize(img, width=800)

# Center crop for AI model input (TensorFlow/PyTorch)
cropped = Netra.center_crop(img, size=(224, 224))

# Flip/Mirror (horizontal, vertical, both)
mirrored = Netra.flip(img, mode="horizontal")
```

### 3. Effects & Enhancement (Lightweight Algorithms)
```python
# Intelligent contrast enhancement (CLAHE)
enhanced = Netra.enhance_contrast(img)

# Vintage Sepia Filter
sepia = Netra.to_sepia(img)

# Pencil Sketch Effect
sketch = Netra.to_sketch(img)

# Cartoon Effect
cartoon = Netra.to_cartoon(img)
```

### 4. Color & Shape Vision
```python
# Isolate specific colors (green, blue, red, yellow)
only_green = Netra.isolate_color(img, "green")

# Detect shapes (Triangle, Square, Circle)
shapes = Netra.find_shapes(img)

# Add Text Watermark
marked = Netra.watermark(img, "NETRA-CV", position=(50, 50))
```

---

## 🛠️ Command Line Interface (CLI)

Netra can also be used directly from the Command Line:

```bash
# View help
netra --help

# Get image info
netra --info sample.jpg

# Sketch conversion
netra --sketch photo.jpg --output result_sketch.jpg

# Quick resize
netra --resize sample.jpg --width 1024 --output resized.jpg
```

---

## ❤️ Credits & Contributors

*   **Lead Architect**: [Muhammad Ikhwan Fathulloh](https://github.com/Muhammad-Ikhwan-Fathulloh)
*   Open-source licensed under [MIT License](LICENSE).

---

"Netra provides eyes to your code."
