Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 13, 2026·2 min de lectura

ImageSharp — Cross-Platform 2D Graphics Library for .NET

A fully managed, cross-platform image processing library for .NET that handles resizing, cropping, format conversion, and drawing without native dependencies.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
ImageSharp Overview
Comando de instalación directa
npx -y tokrepo@latest install e87f0ee2-7e94-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

ImageSharp is a fully managed, cross-platform 2D graphics library for .NET. It replaces the legacy System.Drawing dependency with a modern, allocation-friendly API that runs on Windows, Linux, macOS, and even in containers without native GDI+ or libgdiplus dependencies.

What ImageSharp Does

  • Loads and saves images in JPEG, PNG, BMP, GIF, TIFF, TGA, and WebP formats
  • Provides image processing operations like resize, crop, rotate, and color adjustment
  • Draws text, shapes, and paths onto images via the ImageSharp.Drawing package
  • Reads and writes EXIF, IPTC, and XMP metadata
  • Handles animated GIFs with per-frame processing support

Architecture Overview

ImageSharp operates on a pixel buffer abstraction (Image<TPixel>) that supports multiple pixel formats. Processing operations are applied through a mutation pipeline that chains transformations efficiently. The library uses SIMD-accelerated operations via .NET's Vector types and avoids unmanaged memory, making it safe for serverless and containerized environments.

Self-Hosting & Configuration

  • Install via NuGet: dotnet add package SixLabors.ImageSharp
  • Add SixLabors.ImageSharp.Drawing for text and shape rendering
  • Configure memory allocation limits with Configuration.Default.MemoryAllocator
  • Set maximum image dimensions to prevent denial-of-service from large uploads
  • Use SixLabors.ImageSharp.Web for ASP.NET Core middleware with caching and on-the-fly processing

Key Features

  • Fully managed with zero native dependencies — runs anywhere .NET runs
  • Thread-safe image processing suitable for server-side workloads
  • Pluggable format decoders and encoders for custom image formats
  • Memory-efficient processing with configurable allocation strategies
  • SIMD-accelerated pixel operations for high throughput

Comparison with Similar Tools

  • System.Drawing — Legacy GDI+ wrapper, Windows-only in practice; ImageSharp is cross-platform and actively maintained
  • SkiaSharp — Wraps native Skia library; ImageSharp is fully managed with no native binaries to ship
  • Magick.NET — Wraps ImageMagick; ImageSharp has no native dependency but covers fewer formats
  • Sharp (Node.js) — libvips-based; ImageSharp serves the same role in the .NET ecosystem

FAQ

Q: Is ImageSharp free for commercial use? A: Yes under the Apache 2.0 license for SixLabors.ImageSharp. The Drawing package uses a Six Labors Split License.

Q: Can it handle large images? A: Yes, memory allocation is configurable to stream large images without loading entirely into RAM.

Q: Does it support WebP? A: Yes, WebP encoding and decoding is supported out of the box.

Q: How does performance compare to native libraries? A: ImageSharp is competitive for common operations and benefits from .NET's JIT and SIMD optimizations.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados