ImageSharp

SixLabors活跃维护 有专家点评

面向 .NET 的现代跨平台 2D 图形库,无需依赖系统原生组件即可完成图片解码、编码、绘制与 EXIF 处理。

A modern, cross-platform, 2D Graphics library for .NET

v4.1.3发布于 2026-10-09 09:02 UTC8,049star +2 / 7 天910fork同步于 2026-11-11 05:30 UTC

专家点评

上手难度:进阶更新于 2026-11-11

全托管 C# 图像编解码与处理库,在 .NET 服务端顶替 System.Drawing 和原生 libgdiplus

适用场景

  • ASP.NET 服务端做上传图片的缩放、裁剪、格式转换:System.Drawing.Common 在非 Windows 上已不被官方支持,这里是纯托管替代,容器镜像里不用装 libgdiplus
  • 需要读 EXIF、处理 JPEG/PNG/GIF/TIFF/BMP 的批处理管线:一个 NuGet 包覆盖编解码和像素操作,不用为每种格式拼不同的原生绑定
  • 跨平台桌面或 IoT 场景做程序化绘图(画布、文字、形状):不依赖 Skia/ Cairo 的原生二进制,ARM 小设备上省掉交叉编译原生库的麻烦
  • 需要自己写像素级算法、复用底层构建块而不是只调高层 API:库本身暴露了可扩展的 processor 结构

踩坑

  • 商业闭源使用会撞上 Six Labors Split License:README 明说商业使用需购买许可,选型评审阶段就要确认,不要等上线前才发现;这也是它离开 .NET Foundation 的直接原因,HN 上那条 128 分讨论就是围绕这次许可变更
  • WebP 支持是 issue 区反应数最高的一条(76 反应、68 评论),如果你的输入源里有大量 WebP,先确认当前版本的实际支持程度再决定,不要按 topics 列表里的 webp 标签想当然
  • 从源码构建的门槛比 NuGet 安装高不少:需要 .NET 8 SDK、初始化 Git 子模块和 Git LFS,Windows 上还要开 git 长路径支持;只做二次开发或打补丁的人才会撞上
  • 跨大版本升级要预留时间:issue 里有专门的 pixel processing breaking changes 讨论帖,像素处理 API 有过不兼容调整,锁版本前先看迁移说明

同类对比

SkiaSharp 在需要高质量文字渲染、复杂矢量绘制或极致解码性能时更合适,代价是引入原生依赖;只做 Windows 且不想改代码的老项目可以继续用 System.Drawing.Common,但跨平台部署这条路已经走不通

怎么上手

由 README 提炼,执行前请确认
dotnet add package SixLabors.ImageSharp
硬件要求按 README 说明

README 未说明硬件要求,仅说明基于 .NET 8,可在设备、云和嵌入式/IoT 场景运行

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向 .NET 的高性能全托管跨平台 2D 图形与图像处理库,覆盖设备、云和嵌入式场景

面向 .NET 的现代跨平台 2D 图形库,无需依赖系统原生组件即可完成图片解码、编码、绘制与 EXIF 处理。

核心能力

  • 全托管实现,无需原生依赖即可跨平台运行
  • 提供高层图像处理 API 与可扩展的低层构建块
  • 基于 .NET 8 构建,适配设备、云与 IoT 场景
  • 支持通过 NuGet 安装稳定版,MyGet/Feedz.io 获取开发版

容易踩的坑

采用 Six Labors Split License 1.0,商业使用需购买商业许可;源码构建需安装 .NET 8 SDK 并初始化 Git 子模块与 Git LFS;Windows 下构建需开启 git 长路径支持

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.1.3
  1. v4.1.3最新正式版2026-10-09 · 2026-10-09 09:02 UTC

    What's Changed

    Full Changelog: https://github.com/SixLabors/ImageSharp/compare/v4.1.2...v4.1.3

  2. v3.2.02026-10-09 · 2026-10-09 08:56 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/SixLabors/ImageSharp/compare/v3.1.12...v3.2.0

  3. v4.1.22026-09-14 · 2026-09-14 04:18 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/SixLabors/ImageSharp/compare/v4.1.1...v4.1.2

  4. v4.1.12026-08-20 · 2026-08-20 06:22 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/SixLabors/ImageSharp/compare/v4.1.0...v4.1.1

  5. v4.1.02026-08-11 · 2026-08-11 23:21 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/SixLabors/ImageSharp/compare/v4.0.0...v4.1.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Build Status codecov License: Six Labors Split

    ImageSharp is a high-performance, fully managed, cross-platform 2D graphics API.

    ImageSharp is a mature, fully featured, high-performance image processing and graphics library for .NET, built for workloads across device, cloud, and embedded/IoT scenarios.

    Designed from the ground up to balance performance, portability, and ease of use, ImageSharp provides a powerful yet approachable API for common image processing tasks, along with the low-level building blocks needed to extend the library for specialized workflows.

    Built against .NET 8, ImageSharp can be used in device, cloud, and embedded/IoT scenarios.

    License

    Support Six Labors

    Support the efforts of the development of the Six Labors projects.

    Documentation

    • Detailed documentation for the ImageSharp API is available. This includes additional conceptual documentation to help you get started.
    • Our Samples Repository is also available containing buildable code samples demonstrating common activities.

    Questions

    Code of Conduct

    This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

    Installation

    Install stable releases via Nuget; development releases are available via MyGet.

    Package NameRelease (NuGet)Nightly (Feedz.io)
    SixLabors.ImageSharpNuGetfeedz.io

    Manual build

    If you prefer, you can compile ImageSharp yourself (please do and help!)

    Alternatively, you can work from command line and/or with a lightweight editor on both Linux/Unix and Windows:

    To clone ImageSharp locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:

    git clone https://github.com/SixLabors/ImageSharp
    

    Then set the following config to ensure blame commands ignore mass reformatting commits.

    git config blame.ignoreRevsFile .git-blame-ignore-revs
    

    If working with Windows please ensure that you have enabled long file paths in git (run as Administrator).

    git config --system core.longpaths true
    

    This repository uses Git Large File Storage. Please follow the linked instructions to ensure you have it set up in your environment.

    This repository contains Git Submodules. To add the submodules to the project, navigate to the repository root and type:

    git submodule update --init --recursive
    

    How can you help?

    Please... Spread the word, contribute algorithms, submit performance improvements, unit tests, no input is too little. Make sure to read our Contribution Guide before opening a PR.

    Useful tools for development and links to specifications can be found in our wikipage: Useful-tools-and-links.

    The ImageSharp Team


    Special thanks to JetBrains for supporting us with open-source licenses for their IDEs.