Easy.Tools.ThumbnailMaker
1.0.2
dotnet add package Easy.Tools.ThumbnailMaker --version 1.0.2
NuGet\Install-Package Easy.Tools.ThumbnailMaker -Version 1.0.2
<PackageReference Include="Easy.Tools.ThumbnailMaker" Version="1.0.2" />
<PackageVersion Include="Easy.Tools.ThumbnailMaker" Version="1.0.2" />
<PackageReference Include="Easy.Tools.ThumbnailMaker" />
paket add Easy.Tools.ThumbnailMaker --version 1.0.2
#r "nuget: Easy.Tools.ThumbnailMaker, 1.0.2"
#:package Easy.Tools.ThumbnailMaker@1.0.2
#addin nuget:?package=Easy.Tools.ThumbnailMaker&version=1.0.2
#tool nuget:?package=Easy.Tools.ThumbnailMaker&version=1.0.2
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 imageoptions: 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 imageoutput: Stream containing the output imageoptions: 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 automaticallybool StripMetadata- Remove metadata from outputColorBackground? Background- Background color (used in Pad mode)OutputFormat Output- Output file format and quality settingsWatermark Watermark- Text watermark settingsbool PreventUpscale- Prevents upscaling of the image if the source is smaller than the target size
Watermark
string Text- Watermark textfloat FontSize- Font sizefloat Opacity- Opacity (0 to 1)Anchor Position- Position (e.g. BottomRight)int Margin- Margin in pixelsstring FontFamily- Font family nameThumbnailColor 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
- .NET 6 or later
- SixLabors.ImageSharp (internal dependency)
- SixLabors.Fonts (internal dependency)
- SixLabors.ImageSharp.Drawing (internal dependency)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Third-Party Dependencies
This package uses the following Six Labors libraries:
- SixLabors.ImageSharp
- SixLabors.Fonts
- SixLabors.ImageSharp.Drawing
Six Labors libraries are licensed under the Six Labors Split License:
- Apache 2.0 for open-source or small revenue projects (< $1M/year)
- Commercial License required for other use cases
More information: Six Labors Pricing & Licensing
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 | Versions 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 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. |
-
net10.0
- SixLabors.Fonts (>= 2.1.3)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
-
net6.0
- SixLabors.Fonts (>= 2.1.3)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
-
net8.0
- SixLabors.Fonts (>= 2.1.3)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
-
net9.0
- SixLabors.Fonts (>= 2.1.3)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
-