AIKernel.Providers.Image 0.3.0

dotnet add package AIKernel.Providers.Image --version 0.3.0
                    
NuGet\Install-Package AIKernel.Providers.Image -Version 0.3.0
                    
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="AIKernel.Providers.Image" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AIKernel.Providers.Image" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="AIKernel.Providers.Image" />
                    
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 AIKernel.Providers.Image --version 0.3.0
                    
#r "nuget: AIKernel.Providers.Image, 0.3.0"
                    
#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 AIKernel.Providers.Image@0.3.0
                    
#: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=AIKernel.Providers.Image&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=AIKernel.Providers.Image&version=0.3.0
                    
Install as a Cake Tool

AIKernel image provider

Local CPU processing for .NET 10 and the AIKernel 0.1.4 package family. Windows x64 includes its native OpenCV runtime. The application uses AIKernel.Contracts.Images and configures provider implementations at startup.

dotnet add package AIKernel.Providers.Image --version 0.3.0
using AIKernel.Contracts.Images;
using AIKernel.Providers.Image;

using var provider = new ImageEditProvider(backgroundModelPath: "models/birefnet-lite-512.onnx");
IImageEditProvider editor = provider;
var photo = await File.ReadAllBytesAsync("photo.jpg", cancellationToken);
var illustration = await editor.StylizeAsync(photo, "illustration",
    new ImageStylizationOptions(strength: 0.6), cancellationToken);
var cutout = await editor.RemoveBackgroundAsync(photo,
    new ImageMattingOptions(maskRefineRadius: 6, maskErodePx: 1, decontaminateEdge: true),
    cancellationToken);
await File.WriteAllBytesAsync("illustration.png", illustration, cancellationToken);
await File.WriteAllBytesAsync("cutout.png", cutout, cancellationToken);
  • Styles are illustration, pencil, and detail. Pass no checkpoint when only using the OpenCV styles.
  • Strength ranges from 0 to 1 for all three styles. The provider blends the source and the styled result at intermediate values and preserves the source alpha channel. Strength 0 writes the source pixels as PNG. Strength 1, the default used by the original overload, produces the same result as 0.1.4.
  • For background removal, download the pinned BiRefNet_lite FP32 ONNX file. The provider verifies its size and SHA-256 against ImageEditProvider.BackgroundModelSha256 before loading it. The session is reused between jobs.
  • The optional ImageMattingOptions control guided refinement (0–32 px), inward edge adjustment (0–2 px), and background-color removal at partially transparent edges. Zero disables the corresponding pixel adjustment. With all options at their defaults, background removal preserves the 0.2.0 output.
  • Inputs are PNG (at most 8 bits per sample) and 8-bit JPEG. The defaults are 16 MiB encoded and 4,194,304 pixels decoded. Each image side is at most 8,192 pixels. Outputs preserve pixel dimensions. Background removal multiplies the soft matte by existing transparency.
  • Await the operation before reusing the input buffer. Unsupported input, unknown style, and missing checkpoint throw exceptions. Cancellation can terminate ONNX inference. OpenCV completes the current native operation before observing cancellation. An editor runs one operation at a time.

To tag visible content, load an AIKernel-imported Cosmos 3 Edge reasoner with a trusted SHA-256 for import-manifest.json:

using var taggingProvider = new CosmosImageTagger(edgeDirectory, manifestSha256);
IImageTaggingProvider tagger = taggingProvider;
var tags = await tagger.TagAsync(photo, cancellationToken);

Tagging returns short English tags from the local reasoner. A host with a fixed RAM budget can supply CosmosMemoryOptions and a private SSD directory. The supported image operations use CPU execution. Model weights require separate provisioning. The package carries third-party notices for OpenCV, OpenCvSharp4, ONNX Runtime, and BiRefNet_lite.

Product Compatible and additional computed target framework versions.
.NET 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
0.3.0 73 11/24/2026
0.2.0 81 11/23/2026
0.1.4 85 11/23/2026

Adds optional CPU matte edge refinement, contraction and color decontamination with unchanged default output.