Lyo.Images 1.0.2

dotnet add package Lyo.Images --version 1.0.2
                    
NuGet\Install-Package Lyo.Images -Version 1.0.2
                    
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="Lyo.Images" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lyo.Images" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Lyo.Images" />
                    
Project file
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 Lyo.Images --version 1.0.2
                    
#r "nuget: Lyo.Images, 1.0.2"
                    
#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 Lyo.Images@1.0.2
                    
#: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=Lyo.Images&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Lyo.Images&version=1.0.2
                    
Install as a Cake Tool

Lyo.Images

Production-ready raster image processing for .NET using SixLabors.ImageSharp. Implements IImageService (resize, crop, rotate, watermark, format conversion, thumbnails, compression, metadata, palette extraction, batch processing) plus a generic image-decoration surface (IImageDecorationService): centered/positioned overlay compositing (raster + SVG), stroked frame outlines, caption bands, and outer padding/shadow — all stream-based and chainable through IImageDecorationPipeline.

Features

  • Resize — Max, Crop, Pad, BoxPad, Stretch (ResizeMode).
  • Crop, Rotate, Watermark, Convert format, Thumbnail, Compress.
  • Metadata — Dimensions, format, optional EXIF (device, GPS, date taken) via ImageSharp.
  • Palette — Dominant colors (GetPaletteAsync); optional ignore of transparent pixels (ImageServiceOptions).
  • BatchProcessBatchAsync with ImageProcessRequest / ImageOperation subclasses.
  • Decoration primitivesOverlayAsync (raster center/positioned pad + stroke; SVG documents get a base64 PNG <image> spliced before </svg>), AddFrameAsync (stroked outline with optional rounded corners + fill), AddCaptionAsync (header/footer band, optional notch + rounded outside corners), AddOuterPaddingAsync (rounded card + canvas margin + optional drop shadow). Each accepts a Stream in/out and an ImageFormat?. The pipeline (IImageDecorationPipeline) chains them without intermediate streams.
  • Thread-safe, async, logging/metrics, cancellation.

Examples

Quick start

using Lyo.Images;
using Lyo.Images.Builders;
using Lyo.Common.Enums;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();
services.AddImageSharpImageService(o => o.DefaultQuality = 90);

var sp = services.BuildServiceProvider();
var images = sp.GetRequiredService<IImageService>();

await using var input = File.OpenRead("photo.jpg");
await using var output = File.Create("photo-800.jpg");
await images.ResizeAsync(input, output, 800, 600, ResizeMode.Max, ImageFormat.Jpeg, quality: 90);

Build a QR badge by chaining decoration primitives

using Lyo.Images;
using Lyo.Images.Builders;
using Lyo.Common.Enums;

var decoration = sp.GetRequiredService<IImageDecorationService>();
var qrBytes = File.ReadAllBytes("qr.png");
var logoBytes = File.ReadAllBytes("logo.png");

var result = await decoration.Pipeline(qrBytes)
    .Overlay(logoBytes, b => b
        .WithOverlaySizePercent(18)
        .WithPadColor("#FFFFFF")
        .WithBorder("#000000"))
    .AddCaption(b => b
        .WithText("Scan Me")
        .WithBackgroundColor("#1e293b")
        .WithTextColor("#FFFFFF")
        .WithNotch())
    .AddOuterPadding(b => b
        .WithPanelColor("#FFFFFF")
        .WithCornerRadius(16)
        .WithShadow("#33000000", offsetPx: 6))
    .AddFrame(b => b
        .WithStrokeColor("#1e293b")
        .WithStrokeWidth(2)
        .WithCornerRadius(16))
    .ToByteArrayAsync(ImageFormat.Png);

File.WriteAllBytes("qr-badge.png", result.Data!);

Public API overview

Type Description
IImageService / ImageSharpImageService / ImageServiceBase Primary façade for stream-based image operations and file helpers; ImageSharp backend with full EXIF.
IImageDecorationService / ImageDecorationService Generic decoration primitives: OverlayAsync, AddFrameAsync, AddCaptionAsync, AddOuterPaddingAsync. IImageService inherits this interface.
IImageDecorationPipeline (via IImageDecorationService.Pipeline(byte[]/Stream)) Fluent chain of primitives that keeps a single in-memory image between stages.
OverlayOptionsBuilder / FrameOptionsBuilder / CaptionOptionsBuilder / PaddingOptionsBuilder Fluent option builders under Lyo.Images.Builders; also exposed as configurator overloads on the pipeline (e.g. pipeline.AddFrame(b => b.WithStrokeWidth(2))).
ISpriteSheetExportService / SpriteSheetExportService Spritesheet export, frame crops, animated GIF helpers (Lyo.Images.Sprite).
Extensions DI registration: AddImageSharpImageService (options/action/IConfiguration overloads), AddSpriteSheetExportService.

AddImageSharpImageService also registers IImageDecorationService if not already present, so consumers that resolve only the decoration interface still work.

Public API overview — Namespaces

  • Lyo.Images — services, pipeline, DI extensions, error codes.
  • Lyo.Images.ModelsImageServiceOptions, ImageProcessRequest, WatermarkOptions, OverlayOptions / OverlayPosition, FrameOptions, CaptionOptions / CaptionPlacement, PaddingOptions, ImageMetadata, enums such as ResizeMode and WatermarkPosition.
  • Lyo.Images.Builders — fluent builders for the option types plus pipeline-builder extensions.
  • Lyo.Images.Decoration — internal per-primitive drawers (OverlayDrawer, FrameDrawer, CaptionDrawer, OuterPaddingDrawer) backing ImageDecorationService.
  • Lyo.Images.Sprite / Lyo.Images.Sprite.Models — spritesheet pipeline types.

Build a QR badge by chaining decoration primitives

Stages run in the queued order. SVG input is supported by Overlay; the other primitives require raster input and throw NotSupportedException if the pipeline state is SVG.

Production readiness

  • Thread-safe service usage; validate streams and options per implementation.
  • Streaming-friendly APIs; size limits enforced via ImageServiceOptions.
  • Optional metrics histograms (see Lyo.Images.Constants.Metrics).

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Common — (direct, lyo)
  • Lyo.Exceptions — (direct, lyo)
  • Lyo.Metrics — (direct, lyo)
  • Lyo.Result — (direct, lyo)
  • Microsoft.Extensions.Configuration.Binder 10.0.5 — (direct, microsoft)
  • Microsoft.Extensions.DependencyInjection.Abstractions 10.0.5 — (direct, microsoft)
  • Microsoft.Extensions.Logging.Abstractions 10.0.5 — (direct, microsoft)
  • SixLabors.Fonts 2.1.3 — (direct, third-party)
  • SixLabors.ImageSharp 3.1.12 — (direct, third-party)
  • SixLabors.ImageSharp.Drawing 2.1.7 — (direct, third-party)
  • Microsoft.Extensions.Options.ConfigurationExtensions 10.0.5 — (transitive, microsoft)
  • System.Memory 4.6.3 — (transitive, microsoft, netstandard2.0)
  • System.Text.Json 10.0.5 — (transitive, microsoft, netstandard2.0)
Product 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Lyo.Images:

Package Downloads
Lyo.Images.Web.Components

Reusable Blazor components for image workbenches, sprite animation, and spritesheet extraction.

Lyo.Images.Skia

Image processing library for .NET using SkiaSharp with support for resize, crop, rotate, watermark, and format conversion.

Lyo.QRCode.Web.Components

Reusable Blazor components for QR code generation and preview workflows.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 0 8/19/2026
1.0.1 28 8/18/2026
1.0.0 76 8/16/2026