NumSharp.Bitmap
0.80.0
dotnet add package NumSharp.Bitmap --version 0.80.0
NuGet\Install-Package NumSharp.Bitmap -Version 0.80.0
<PackageReference Include="NumSharp.Bitmap" Version="0.80.0" />
<PackageVersion Include="NumSharp.Bitmap" Version="0.80.0" />
<PackageReference Include="NumSharp.Bitmap" />
paket add NumSharp.Bitmap --version 0.80.0
#r "nuget: NumSharp.Bitmap, 0.80.0"
#:package NumSharp.Bitmap@0.80.0
#addin nuget:?package=NumSharp.Bitmap&version=0.80.0
#tool nuget:?package=NumSharp.Bitmap&version=0.80.0
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.Commonis 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.
Links
- Documentation: https://scisharp.github.io/NumSharp/docs/extensions/bitmap.html
- Source: https://github.com/SciSharp/NumSharp
Licensed under the Apache License 2.0.
What's new in 0.80.0
We are at 95.2% NumPy API coverage, and everything except datetime, complex64 and other exotic dtypes matches NumPy byte for byte. This release brings NumPy's text dtypes with numpy.strings and numpy.char, numpy.ma, numpy.polynomial, np.emath and 48 new np.* functions. Integration rather than competition goes on, this time inside .NET: an NDArray now runs through ONNX Runtime models, serves as an ML.NET IDataView and shares its memory with System.Numerics.Tensors.
🧭 Overview
- NumPy 2.x API coverage around 95.2%, everything except datetime, complex64 and other exotic dtypes is fully supported, with byte-to-byte equality and compatibility to NumPy.
- Text - NumPy's fixed-width
bytes_(S) andstr_(U) dtypes and NEP 55's variable-widthStringDType, with every computation NumPy runs on text, all 46numpy.stringsfunctions andnumpy.charwithchararray. np.polynomial.*- the wholenumpy.polynomialpackage, all 193 functions and the six series classes for all six bases, bit-exact.np.*- +48 functions, the ten most used on GitHub:np.hypot,np.histogram,np.logspace,np.gradient,np.vectorize,np.hanning,np.geomspace,np.apply_along_axis,np.trapezoidandnp.histogram2d.np.random.*- every NumPy bit generator, the wholeGeneratordistribution surface, and a legacyRandomStatethat is NumPy's own sampler code line for line, all byte-identical streams.np.ma.*- the masked-array module;np.emath.*- the automatic-domain math module;np.matrix-numpy.matrixas the newNDMatrixtype.
- Text - NumPy's fixed-width
DTypeis NumPy's two-level dtype model -NDArray.dtypereturns anumpy.dtype-shaped descriptor, withnp.dtypes, byte order anddatetime64/timedelta64descriptors, and NumPy's scalar classes (np.integer,np.floating,np.number, ...) withnp.typing.- Reductions on NumPy's own schedules -
max,min,ptp,nanmax,nanmin,argmax, the flatsum/meanand the fusednp.evaluatereductions match NumPy bit for bit, down to the sign of a ±0 tie and a NaN's payload;mean,var,stdand their NaN-aware forms are NumPy's own statements; and most of them run faster. - NumPy's structure for the engine - every computing
np.*function is aTensorEnginemember named after its NumPy source file,numpy.linalgandnumpy.fftare replaceable sub-engines, and the default engine is settable. - The 2026-11-02 parity QA - 53 of its 55 findings fixed on the owner's decisions (one kept as a documented divergence, one deferred), and NumPy's own dot functions behind
np.dot/np.vdot/np.vecdot. - 86 NumPy-parity, memory-safety and tooling fixes, 40 measured speedups and 44 breaking changes, across the release's 1,670 commits.
- 3 new NuGet packages - NumSharp.Interop.System.Numerics.Tensors, NumSharp.Interop.OnnxRuntime and NumSharp.Interop.MLNet.
- 1,119,305 NumPy 2.4.2 oracle test cases (0.70.0: 119,517) and 20,506 test methods (0.70.0: 14,416).
📦 New NuGet Packages
- NumSharp.Interop.System.Numerics.Tensors - zero-copy interop between
NDArrayand the BCL'sTensor<T>/TensorSpan<T>(System.Numerics.Tensors), all 15 dtypes. - NumSharp.Interop.OnnxRuntime - run ONNX Runtime models on
NDArrays, fed from the arrays' own memory, with the outputs read back asNDArrays. - NumSharp.Interop.MLNet - an
NDArrayas an ML.NETIDataView, and a transformer's output column back as anNDArray.
| Product | Versions 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. |
-
net10.0
- NumSharp (>= 0.80.0)
- System.Drawing.Common (>= 8.0.0)
-
net8.0
- NumSharp (>= 0.80.0)
- System.Drawing.Common (>= 8.0.0)
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.80.0 | 92 | 11/8/2026 |
| 0.70.0 | 177 | 9/6/2026 |
| 0.60.0 | 167 | 6/28/2026 |
| 0.50.0-prerelease | 131 | 4/12/2026 |
| 0.42.0-prerelease | 129 | 4/12/2026 |
| 0.41.0-prerelease | 137 | 3/23/2026 |
| 0.40.0-prerelease | 129 | 7/19/2026 |
| 0.30.0 | 6,355 | 4/2/2021 |
| 0.20.4 | 10,858 | 10/5/2019 |
| 0.20.2 | 898 | 9/11/2019 |
Added complicated shape and bbp inference mechanism. Added argument 'discardAlpha' to all methods.