MxPlot: Multi-Axis Matrix Visualization Library for .NET. This project is currently under active development.
$ dotnet add package MxPlot.Extensions.ImagesHigh-Performance Image Loading for MatrixData (Powered by SkiaSharp)
This package provides a simple image loader for MatrixData<T>, utilizing SkiaSharp as the decoding engine.
It enables seamless conversion of standard image formats (PNG, JPEG, BMP, TIFF, etc.) into mathematical matrices, supporting various numeric types including double, float, and even System.Numerics.Complex.
It is designed for scientific analysis, signal processing, and visualization workflows within the MxPlot ecosystem.
byte, int, float, or double matrices.ComplexNormalizationDivisor to scale pixel values (e.g., 0-255 to 0.0-1.0) during the loading process.flipY option (default: true) to align image coordinates with mathematical Cartesian coordinates (origin at bottom-left).The BitmapImageFormat class integrates directly with the MatrixData<T>.Load static method.
using MxPlot;
using MxPlot.Extensions.Images;
// Load an image, decompose to RGB, and normalize to 0.0 - 1.0
var format = new BitmapImageFormat
{
Mode = BitmapReadMode.RGBDecomposed,
NormalizationDivisor = 255.0
};
var md = MatrixData<double>.Load("photo.png", format);
// Access channels: md.GetArray(0) is Red, (1) is Green, (2) is Blue// Pixel values (0-255) are stored in the Real part of the Complex numbers
var format = new BitmapImageFormat { Mode = BitmapReadMode.GrayScale };
var complexMatrix = MatrixData<Complex>.Load("signal.bmp", format);
SkiaSharp: Used for cross-platform image decoding.
MxPlot.Core: Provides the base MatrixData<T> structure and IMatrixDataReader interface.
By default, this loader uses flipY = true. This ensures that the data index [0] corresponds to the bottom-left of the image, making it consistent with standard mathematical plotting and coordinate systems.
For the complete changelog and version history, please visit the Releases Page on GitHub.