Etymon.ImageHelper 1.0.5

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

Etymon.ImageHelper

Etymon.ImageHelper is a lightweight, cross-platform C# image processing library designed for modern .NET applications.
It provides a clean, high-performance abstraction for:

  • Image resizing
  • Compression
  • WebP conversion
  • Padding (canvas resizing)
  • Local file uploads
  • Azure Blob Storage uploads

Powered by SkiaSharp for safe, fast, cross-platform image handling.


πŸš€ Features

  • ✨ Cross-platform image processing (SkiaSharp – no System.Drawing)
  • πŸ–ΌοΈ Resize, scale, pad with background color
  • 🌐 Convert images to WebP
  • πŸ“¦ Compress images (JPEG quality control)
  • πŸ’Ύ Save files locally (unique file naming)
  • ☁️ Upload to Azure Blob Storage with full HTTP header control
  • πŸ” Prevent filename collisions (local + cloud)
  • πŸ”§ Clean, modular architecture

πŸ“¦ Installation

dotnet add package Etymon.ImageHelper

🧩 Components Overview

Component Purpose
ImageProcessor Resize, compress, convert, pad images
FileNameHelper Safe filename + unique name generator
LocalFileStorageService Save files locally
AzureBlobStorageService Upload images/files to Azure Blob Storage
FileUploadResponseModel Standard upload output

Everything is dependency-free except SkiaSharp + Azure.Storage.Blobs.


πŸ–ΌοΈ Basic Usage

1️⃣ Resize an Image

using Etymon.ImageHelper;

using var stream = File.OpenRead("input.jpg");
var bitmap = ImageProcessor.Resize(
    ImageProcessor.Load(stream),
    maxWidth: 800,
    maxHeight: 800,
    force: false
);

var bytes = ImageProcessor.Encode(bitmap, ".jpg", 85);
File.WriteAllBytes("output.jpg", bytes);

2️⃣ Convert to WebP

using var stream = File.OpenRead("input.png");
var webpBytes = ImageProcessor.ConvertToWebp(stream);
File.WriteAllBytes("output.webp", webpBytes);

3️⃣ Add Padding (Fixed Canvas)

var padded = ImageProcessor.ResizeWithPadding(
    srcBitmap,
    canvasW: 600,
    canvasH: 600,
    bgColor: new SKColor(255, 255, 255)
);

πŸ’Ύ Local File Upload

var storage = new LocalFileStorageService(webRootPath);

string fileName = storage.Save(formFile, "uploads/images");
// returns safe, unique file name

☁️ Azure Blob Storage Upload

var blobService = new AzureBlobStorageService(
    connectionString,
    containerName
);

var result = await blobService.UploadAsync(
    fileControl,
    folder: "product-images",
    existingNames: existingBlobNames
);

if (result.Success)
{
    Console.WriteLine(result.OriginalImageFullPath);
}

πŸ“˜ Sample Response Model

{
  "success": true,
  "originalImageFullPath": "https://yourstorage.blob.core.windows.net/container/upload/image1.jpg"
}

πŸ“ File Naming Utilities

string safe = FileNameHelper.GetSafeFileName("My Image 2025!!.jpg");
// my_image_2025.jpg

string unique = FileNameHelper.GetUniqueFileName("/app/wwwroot/uploads", safe);

πŸ”§ Why SkiaSharp?

System.Drawing.Common is not supported on:

  • Linux
  • macOS
  • Docker
  • Azure App Service (Linux)
  • .NET 7+

SkiaSharp:

βœ” cross-platform
βœ” GPU-optimized
βœ” production-safe
βœ” Google’s Skia engine (Chrome, Android)


πŸ› οΈ Project Structure

/Etymon.ImageHelper
 β”œβ”€β”€ ImageProcessor.cs
 β”œβ”€β”€ LocalFileStorageService.cs
 β”œβ”€β”€ AzureBlobStorageService.cs
 β”œβ”€β”€ FileNameHelper.cs
 β”œβ”€β”€ FileUploadResponseModel.cs
 └── README.md

🧭 Roadmap (Upcoming Features)

  • AVIF encoding support
  • EXIF metadata utilities
  • Automatic image orientation (based on EXIF rotation)
  • Streaming-based transformations
  • Built-in validation (max size, allowed types, etc.)

❀️ Contribute / Feedback

This library is maintained by Etymon Technologies.
Feedback, improvements, or feature requests are welcome!

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.5 233 11/29/2025
1.0.4 139 11/29/2025
1.0.3 128 11/29/2025
1.0.2 129 11/29/2025
1.0.1 113 11/29/2025
1.0.0 130 11/29/2025