Leptonica.Managed 1.0.1

dotnet add package Leptonica.Managed --version 1.0.1
                    
NuGet\Install-Package Leptonica.Managed -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Leptonica.Managed" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Leptonica.Managed" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Leptonica.Managed" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Leptonica.Managed --version 1.0.1
                    
#r "nuget: Leptonica.Managed, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Leptonica.Managed@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Leptonica.Managed&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Leptonica.Managed&version=1.0.1
                    
Install as a Cake Tool

Leptonica.Managed

A fully managed C# implementation of Leptonica 1.87.0, the image processing and image analysis library written by Dan Bloomberg.

  • No P/Invoke, no native binaries. Every function is translated to C#, including the image codecs, so the package runs wherever .NET runs.
  • The same results as the C library. Leptonica's own regression tests, ported to C#, compare the results with golden files produced by the C library.
  • Made for .NET. SIMD, multithreading, and GPU acceleration through ILGPU for some operations when a CUDA or OpenCL device is present; without a GPU everything runs on the CPU.
using Leptonica;

Pix page = Pix.Read("page.jpg");
Pix gray = page.ConvertTo8(false);
Pix flat = gray.BackgroundNormSimple(null, null);
Pix straight = flat.Deskew(0);
straight.OtsuAdaptiveThreshold(200, 200, 0, 0, 0.1f, out _, out Pix binary);
Pix.Write("page-binary.png", binary, L.IFF_PNG);

The C documentation applies: pixDeskew(pixs, 0) is pixs.Deskew(0), pixRead(name) is Pix.Read(name), output arguments are out parameters and errors are exceptions.

Documentation, the mapping from the C API and benchmarks: github.com/sensboston/Leptonica.Managed.

Leptonica is the work of Dan Bloomberg; this package exists thanks to it. License: BSD 2-Clause, like Leptonica; the licenses of the included codec libraries are in THIRD-PARTY-NOTICES.txt.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 47 11/6/2026
1.0.0 98 11/4/2026