Etymon.ImageHelper
1.0.5
dotnet add package Etymon.ImageHelper --version 1.0.5
NuGet\Install-Package Etymon.ImageHelper -Version 1.0.5
<PackageReference Include="Etymon.ImageHelper" Version="1.0.5" />
<PackageVersion Include="Etymon.ImageHelper" Version="1.0.5" />
<PackageReference Include="Etymon.ImageHelper" />
paket add Etymon.ImageHelper --version 1.0.5
#r "nuget: Etymon.ImageHelper, 1.0.5"
#:package Etymon.ImageHelper@1.0.5
#addin nuget:?package=Etymon.ImageHelper&version=1.0.5
#tool nuget:?package=Etymon.ImageHelper&version=1.0.5
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 | Versions 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. |
-
net8.0
- Azure.Storage.Blobs (>= 12.26.0)
- SkiaSharp (>= 3.119.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.