SimdImaging 0.1.0-alpha
This is a prerelease version of SimdImaging.
dotnet add package SimdImaging --version 0.1.0-alpha
NuGet\Install-Package SimdImaging -Version 0.1.0-alpha
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="SimdImaging" Version="0.1.0-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimdImaging" Version="0.1.0-alpha" />
<PackageReference Include="SimdImaging" />
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 SimdImaging --version 0.1.0-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimdImaging, 0.1.0-alpha"
#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 SimdImaging@0.1.0-alpha
#: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=SimdImaging&version=0.1.0-alpha&prerelease
#tool nuget:?package=SimdImaging&version=0.1.0-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SimdImaging
托管 .NET 图像处理层。底层编解码由 Sdcb.SimdCodecs 承担,本包只做解码之后、编码之前的像素工作。
纯托管、零原生依赖、NativeAOT 一等公民。AVX2 / Vector128 / 标量三档 SIMD 输出逐字节一致。
安装
dotnet add package SimdImaging
目标框架 net10.0。SimdImaging.Abstractions 与 SimdImaging.Processing 作为依赖自动安装,无需单独引用。
用法
using SimdImaging;
using var photo = Image.Load("photo.jpg"); // 位深跟随源:8 → Rgba8,16 → Rgba16,float → Rgba32F
using var small = photo.Pipe().Resize(800, 600).ToImage();
Image.Save(small, "out.png");
一串算子写成一条链。链的价值在内存:逐步调用每一步都要一张整图,链把同尺寸的连续步骤压成一遍行带。
using var edited = photo.Pipe()
.Crop(rect)
.Resize(800, 600)
.Saturation(1.2f)
.GaussianBlur(1.5f)
.ToImage();
链是惰性的,ToImage() 才执行;结果图持有池化内存,必须 using。
文件进文件出、不整图载入:
ImageTranscode.From("in.jpg").GaussianBlur(1f).Resize(1600, 900).Save("out.png");
能做什么
- 几何:Crop / Pad / Flip / Rotate 90·180·任意角 / Resize(16 种采样器)/ Affine / Perspective / 接缝裁剪
- 点算子:Brightness / Contrast / Saturation / Vibrance / Grayscale / Invert / Gamma / Threshold / Posterize / Levels / ColorMatrix / HueRotate / Sepia / Temperature / Tint / ColorBalance / ChannelSwap / BlackWhite / Curves / Normalize / Opacity / Clamp
- 滤波:Gaussian / Box / Median / Sobel / Prewitt / Scharr / 形态学 3×3 / 开闭运算 / 双边 / 卷积 / 浮雕 / 锐化 / 运动模糊 / 散景 / 渐变 / 贴图 / 水印
- 合成与绘制:Porter-Duff 12 式 + 18 种混合模式、填充 / 清空 / 矩形描边 / Bresenham 直线 / 椭圆与多边形填充
- 高级摄影:非局部均值、局部拉普拉斯、Richardson-Lucy 反卷积、去雾、多帧曝光融合
- 色彩与 HDR:ICC(matrix/TRC 与 RGB LUT 型 profile)、CIEDE2000、五种色调映射、增益图、Ultra HDR 读写
- 量化与分析:中位切分 / Wu / WebSafe / 抖动、直方图与均衡、距离变换、通道统计
- 文件级:
ImageTranscode、Image.DescribeRegion、Image.ProcessTiles
性能
21 项算子端到端对拍 ImageSharp 4.1.3(同进程交错计时,稳态中位):
| 尺寸 | 总加速比 | 领先 / 持平 / 落后 |
|---|---|---|
| 640×360 | 1.73× | 15 / 1 / 5 |
| 1920×1080 | 2.15× | 20 / 1 / 0 |
| 3840×2160 | 1.95× | 20 / 1 / 0 |
| 7680×4320 | 1.87× | 18 / 1 / 2 |
中间尺寸没有落后项。落后集中在两端:小图上固定开销占比高,8K 上带宽主导。
版本
0.1.0-alpha。尚未发布稳定版,minor 版本可能包含破坏性调整;对外契约以 docs/public-api.txt 快照为准。
许可
Apache-2.0。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Sdcb.SimdCodecs (>= 2.1.0)
- Sdcb.SimdCodecs.Tiff (>= 2.1.0)
- SimdImaging.Abstractions (>= 0.1.0-alpha)
- SimdImaging.Processing (>= 0.1.0-alpha)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha | 63 | 11/29/2026 |