Easy.Tools.ThumbnailMaker 1.0.0

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

Build & Test Build & Release Build & Nuget Publish Release License NuGet

Easy.Tools.ThumbnailMaker

Easy.Tools.ThumbnailMaker is a lightweight and flexible .NET library that enables quick and easy creation of thumbnails (small preview images), resizing images, and adding text watermarks in your applications.


Features

  • Asynchronous image loading and thumbnail generation
  • Automatic EXIF orientation correction (auto-orient)
  • Flexible resize modes: Fit, Cover, Pad, Crop, Contain
  • Background color and padding support
  • Text watermark with customizable position, font, color, size, and opacity
  • JPEG and PNG output formats
  • Metadata stripping options (EXIF, ICC, XMP profiles)
  • Minimal external dependencies, high performance
  • Cross‑platform (Windows, Linux, macOS)

Installation

Install via NuGet:

dotnet add package Easy.Tools.ThumbnailMaker

Usage

Simple thumbnail creation

using ThumbnailMakers;

// Input and output file paths
await using var input = File.OpenRead("test.jpeg");
await using var output = File.Create("test1.jpeg");

// Define thumbnail colors
var white = ThumbnailColor.White;
var red = new ThumbnailColor(255, 0, 0);
var semiTransparentBlue = new ThumbnailColor(0, 0, 255, 128);
var fromHex1 = ThumbnailColor.FromHex("#FF0000");        // RRGGBB
var fromHex2 = ThumbnailColor.FromHex("80FF0000");       // AARRGGBB

// Create a thumbnail with specific options
var opts = new ThumbnailOptions(320, 320)
{
    Mode = ThumbnailResizeMode.Cover,
    Output = OutputFormat.Jpeg(85),
    Watermark = Watermark.TextMark("© ACME", size: 18, opacity: 100f, color: red)

};

// Create the thumbnail
await Thumbnail.MakeAsync(input, output, opts);

Details

Thumbnail.MakeAsync(Stream input, ThumbnailOptions options, CancellationToken ct = default)

  • input: Stream containing the source image
  • options: Thumbnail creation options (ThumbnailOptions)
  • ct: Cancellation token (optional)
  • Returns: Byte array of the created thumbnail image

Thumbnail.MakeAsync(Stream input, Stream output, ThumbnailOptions options, CancellationToken ct = default)

  • input: Stream containing the source image
  • output: Stream containing the output image
  • options: Thumbnail creation options (ThumbnailOptions)
  • ct: Cancellation token (optional)
  • Returns: Task representing the asynchronous operation

ThumbnailOptions

  • int Width - Thumbnail width (required)
  • int Height - Thumbnail height (required)
  • ThumbnailResizeMode Mode - Resize mode (Fit, Cover, Pad, Crop, Contain)
  • Anchor Anchor - Represents the anchor point for positioning elements in a thumbnail.
  • bool AutoOrient - Apply EXIF orientation correction automatically
  • bool StripMetadata - Remove metadata from output
  • ColorBackground? Background - Background color (used in Pad mode)
  • OutputFormat Output - Output file format and quality settings
  • Watermark Watermark - Text watermark settings
  • bool PreventUpscale - Prevents upscaling of the image if the source is smaller than the target size

Watermark

  • string Text - Watermark text
  • float FontSize - Font size
  • float Opacity - Opacity (0 to 1)
  • Anchor Position - Position (e.g. BottomRight)
  • int Margin - Margin in pixels
  • string FontFamily - Font family name
  • ThumbnailColor color - Color (hex, Rgb, etc.)

Supported ThumbnailResizeModes

Mode Description
Fit Maintain aspect ratio, fit inside target size
Cover Fill entire area, cropping if necessary
Pad Maintain aspect ratio, add padding as needed
Crop Crop to exact size, focusing on anchor position
Contain Maintain aspect ratio, scale down if needed

Requirements


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions and feedback are welcome! Please start by opening an issue.


Contact

For questions, contact us via elmin.alirzayev@gmail.com or GitHub.


© Elmin Alirzayev 2025 / Easy Code Tools

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 was computed.  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 was computed.  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

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
1.0.0 133 8/13/2025

-