ImageData 1.1.0
dotnet add package ImageData --version 1.1.0
NuGet\Install-Package ImageData -Version 1.1.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="ImageData" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ImageData" Version="1.1.0" />
<PackageReference Include="ImageData" />
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 ImageData --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ImageData, 1.1.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 ImageData@1.1.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=ImageData&version=1.1.0
#tool nuget:?package=ImageData&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Image Data
A lightweight .NET library providing efficient handling of image data with support for multiple pixel formats and serialization.
Features
- 🖼 Image Data Handling — Encapsulates pixel buffers in the
ImageDatastruct with width, height, stride, and format metadata. - 🔄 Serialization Support — Convert images to and from byte arrays or streams for efficient storage and transfer.
- 🧩 Supported Formats — Multiple pixel formats such as Mono8, Mono16, Rgb24, Rgb32.
- ⚡ Zero-Copy Parsing — Optimized APIs like
TryFromMemoryavoid unnecessary allocations when possible. - 🎯 Lightweight — Minimal dependencies, focused on core image data representation.
Installation
Add the project or library to your solution. If published as a NuGet package, install via:
dotnet add package ImageData
Working with ImageData
Serialize to Array
var camera = new DummyCamera();
ImageData img = camera.GetImage();
byte[] serialized = img.ToArray();
Deserialize from Array
ImageData img2 = ImageData.FromArray(serialized);
Zero-Copy Parse from Memory
if (ImageData.TryFromMemory(serialized, out var img3))
{
Console.WriteLine($"Image parsed: {img3.Width}x{img3.Height}, {img3.Format}");
}
Read/Write from Stream
using var ms = new MemoryStream();
img.WriteTo(ms);
ms.Position = 0;
ImageData img4 = ImageData.ReadFrom(ms);
Supported Image Formats
- Mono8 – 8-bit grayscale
- Mono16 – 16-bit grayscale
- Rgb24 – 24-bit RGB
- Rgb32 – 32-bit RGB (with alpha or padding)
- Raw8 / Raw16 – Raw image buffers
License
MIT License — free to use, modify, and distribute.
| 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 is compatible. 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 was computed. 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.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ImageData:
| Package | Downloads |
|---|---|
|
CameraInterface
a small package that has a Camera Interface. |
|
|
ImageData.Skia
Extension method for the ImageData object to convert it to a Skia Bitmap. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed namespace