Install
dotnet add package ImageData --version 1.1.0
| Product | Versions |
|---|---|
| .NET |
README
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.
Changes from Previous Version
No structural changes between v1.0.0 and v1.1.0.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.