LegioSoft.Imaging.Core 1.0.0

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

LegioSoft.Imaging.Core

Core interfaces, enums, and base types for LegioSoft.Imaging. Extremely lightweight library containing only shared types.

Installation

dotnet add package LegioSoft.Imaging.Core

Features

  • Core Interfaces - ILegioImageEncoder, ILegioImageDecoder, ILegioImageResizer, ILegioImageCropper, ILegioImageTransformer, ILegioImageFilter
  • Enums - LegioImageFormat, LegioScaleMode, LegioResizeQuality, LegioEncodingQuality, LegioTransformType, LegioFilterType
  • Base Types - LegioImageInfo class for image metadata

Core Types

Classes

  • FormatDetector - Securely detect image format from byte arrays with validation
  • LegioImageInfo - Image metadata (width, height, format, alpha channel, byte size)

Interfaces

  • ILegioImageEncoder - Encode images to byte arrays and streams
  • ILegioImageDecoder - Decode images and get metadata
  • ILegioImageResizer - Resize images with various modes and quality levels
  • ILegioImageCropper - Crop images to specified regions
  • ILegioImageTransformer - Rotate and flip images
  • ILegioImageFilter - Apply filters like grayscale, sepia, blur, and sharpen

Enums

  • LegioImageFormat - PNG, JPEG, WebP
  • LegioScaleMode - Fit, Fill, Stretch
  • LegioResizeQuality - Low, Medium, High, Maximum
  • LegioEncodingQuality - Quality levels for encoding
  • LegioTransformType - Rotation transformations
  • LegioFilterType - Filter types

Usage

Use this package to reference core types without bringing in image processing dependencies:

using LegioSoft.Imaging.Core;

// Detect image format from byte array
var imageData = File.ReadAllBytes("image.jpg");
var format = FormatDetector.DetectFormat(imageData);
Console.WriteLine($"Format: {format}"); // Jpeg

// Get image info (requires implementation package)
var info = new LegioImageInfo
{
    Width = 1920,
    Height = 1080,
    Format = LegioImageFormat.Jpeg,
    HasAlpha = false,
    ByteSize = 102400
};

// Use enums for settings
var mode = LegioScaleMode.Fit;
var quality = LegioResizeQuality.High;

Format Detection

FormatDetector.DetectFormat() securely identifies image formats:

  • Validates input data (null, empty, too short)
  • Checks file signatures (magic bytes) for: PNG, JPEG, WebP
  • Throws NotSupportedException for unknown formats
  • Throws ArgumentException for corrupted/invalid files

Supported formats: PNG, JPEG, WebP

Platform Support

  • .NET 6.0, 7.0, 8.0, 9.0, 10.0
  • Windows, Linux, macOS (all platforms)

Dependencies

  • No external dependencies
  • Pure .NET library

License

Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on LegioSoft.Imaging.Core:

Package Downloads
LegioSoft.Imaging.Skia

Full-featured image processing library built on SkiaSharp. Implements ILegioImageResizer, ILegioImageCropper, ILegioImageTransformer, and ILegioImageFilter interfaces. Provides fluent builder API for easy image manipulation. Supports resize, crop, rotate, flip, and filters (grayscale, sepia, blur, sharpen, brightness, contrast, invert). Format conversion for PNG, JPEG, and WebP. Cross-platform support for Windows, macOS, and Linux. Supports .NET 6.0, 7.0, 8.0, 9.0, and 10.0.

LegioSoft.Imaging.WebP

WebP codec wrapper using native libwebp v1.6.0. High-performance WebP encoding and decoding with support for RGBA, RGB, BGRA, BGR formats. Features include lossless/lossy compression, scaling, cropping, flip, and advanced encoding options. Updated for libwebp 1.6.0 with correct ABI version (0x0210) and proper memory management (WebPMemoryWriterClear). Cross-platform support (Windows, Linux, macOS). Implements ILegioImageEncoder and ILegioImageDecoder interfaces from Core package. Use FormatDetector from Core for format detection.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 308 1/16/2026
1.0.0-beta3 121 1/10/2026
1.0.0-beta2 96 1/9/2026
1.0.0-beta1 99 1/9/2026

Initial release of LegioSoft.Imaging.Core.

     Features:
     - FormatDetector for secure image format detection with validation
     - ILegioImageEncoder and ILegioImageDecoder interfaces for encoding/decoding
     - ILegioImageResizer for resize operations
     - ILegioImageCropper for crop operations
     - ILegioImageTransformer for rotate/flip operations
     - ILegioImageFilter for filter operations (grayscale, sepia, blur, sharpen)
     - LegioImageFormat enum (PNG, JPEG, WebP, BMP, GIF)
     - LegioScaleMode enum (Fit, Fill, Stretch)
     - LegioResizeQuality enum (Low, Medium, High, Maximum)
     - LegioEncodingQuality enum (0-100 quality levels)
     - LegioImageInfo class for image metadata
     - Support for .NET 6.0, 7.0, 8.0, 9.0, and 10.0