Skip to content

Repository files navigation

Morpheus.Imaging

Build Status Framework License

High-performance .NET 10 image augmentation and document degradation library. A native .NET port and enhancement of the Augraphy Python project.

Designed for document processing pipelines, OCR stress-testing, synthetic data generation, and machine learning training datasets.


Features

  • Document Degradations: Bad photocopy, ink bleed, fax simulation, page borders, binding marks, folds, crumples, stains, scribbles.
  • Lighting & Color: Glitch effects, color shifts, lighting gradients, low-light noise, brightness texturizing.
  • Geometric & Distortion: Perspective shift, squish, section shift, depth-simulated blur, Delaunay triangulation patterns.
  • Native Efficiency: Built on SkiaSharp and OpenCVSharp with native Debian 12/Linux x64 runtime bindings included.
  • Zero Heavy External Dependencies: Built-in barcode and QR utilities via ZXing.Net.

Installation

Add the package to your .NET 10 project:

dotnet add package Morpheus.Imaging

Quick Start

using Morpheus.Imaging.Base;
using Morpheus.Imaging.Augmentations;
using SkiaSharp;

// Load source document image
using var bitmap = SKBitmap.Decode("input_document.png");
var data = new AugmentationData(bitmap);

// Define augmentation pipeline
var pipeline = new AugraphyPipeline(
    paperAugmentations: new List<Augmentation>
    {
        new PageBorder(borderWidthRange: (10, 20)),
        new ColorPaper(paperColor: SKColors.LightYellow)
    },
    postAugmentations: new List<Augmentation>
    {
        new DirtyRollers(lineAmountRange: (2, 5)),
        new BleedThrough(alphaRange: (0.1f, 0.3f))
    }
);

// Process image
var result = pipeline.Process(data);
using var outputImage = result.OutputBitmap;

// Save degraded image
using var stream = File.OpenWrite("degraded_document.png");
outputImage.Encode(stream, SKEncodedImageFormat.Png, 100);

Architecture & Native Bindings

Morpheus.Imaging ships pre-compiled Linux x64 native runtime bindings for OpenCVSharp (libOpenCvSharpExtern.so).

  • Cross-Platform Compatibility: Tested on Windows x64 and Linux Debian 12 / Ubuntu environments.
  • Figshare Assets: Asset pre-fetching for high-resolution noise patterns can be dynamically downloaded via FigshareDownloader.

License

This project is licensed under the MIT License.

About

.NET 10 implementation of the Python Augraphy library with SkiaSharp-based rendering

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages