NumSharp.Bitmap 0.70.0

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

NumSharp.Bitmap

Windows-only extensions that bridge System.Drawing.Bitmap and NumSharp's NDArray, with or without copying pixel data. Uses GDI+ via System.Drawing.Common.

This is an extension package for NumSharp — it depends on and builds on the core library.

Install

dotnet add package NumSharp.Bitmap

Windows only. System.Drawing.Common is supported on Windows only; on other platforms these APIs throw at runtime.

Quick start

using System.Drawing;
using NumSharp;
using NumSharp.Bitmap;

using var bmp = (Bitmap)Image.FromFile("input.png");

// Bitmap -> NDArray (shape [height, width, channels]); discardAlpha drops the alpha channel.
NDArray pixels = bmp.ToNDArray(copy: true, discardAlpha: true);

// ... manipulate pixels with np.* ...

// NDArray -> Bitmap
using Bitmap outBmp = pixels.ToBitmap();

Every conversion method takes a discardAlpha argument, and ToNDArray takes flat and copy flags to control raveling and whether pixel data is shared or copied.

Licensed under the Apache License 2.0.

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 (1)

Showing the top 1 popular GitHub repositories that depend on NumSharp.Bitmap:

Repository Stars
microsoft/Microsoft-Rocket-Video-Analytics-Platform
A highly extensible software stack to empower everyone to build practical real-world live video analytics applications for object detection and counting with cutting edge machine learning algorithms.
Version Downloads Last Updated
0.70.0 62 9/6/2026
0.60.0 147 6/28/2026
0.50.0-prerelease 112 4/12/2026
0.42.0-prerelease 108 4/12/2026
0.41.0-prerelease 114 3/23/2026
0.40.0-prerelease 99 7/19/2026
0.30.0 6,300 4/2/2021
0.20.4 10,772 10/5/2019
0.20.2 876 9/11/2019

Added complicated shape and bbp inference mechanism. Added argument 'discardAlpha' to all methods.