Skip to main content

a small package that has a nice abstracted Image Data record.

Total Downloads
377
377
Published
Oct 18, 2025
1y ago

Get Started

dotnet add package ImageData --version 1.1.0
ProductVersions
.NET
net8.0net9.0

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 ImageData struct 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 TryFromMemory avoid 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.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

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.