Swevo.AutoImage
1.1.0
Prefix Reserved
dotnet add package Swevo.AutoImage --version 1.1.0
NuGet\Install-Package Swevo.AutoImage -Version 1.1.0
<PackageReference Include="Swevo.AutoImage" Version="1.1.0" />
<PackageVersion Include="Swevo.AutoImage" Version="1.1.0" />
<PackageReference Include="Swevo.AutoImage" />
paket add Swevo.AutoImage --version 1.1.0
#r "nuget: Swevo.AutoImage, 1.1.0"
#:package Swevo.AutoImage@1.1.0
#addin nuget:?package=Swevo.AutoImage&version=1.1.0
#tool nuget:?package=Swevo.AutoImage&version=1.1.0
AutoImage
Free, MIT-licensed fluent image processing for .NET. No revenue threshold, no commercial license — ever.
Why AutoImage?
ImageSharp is licensed under the Six Labors Split License: free for individuals, open source projects, and companies under $1M annual revenue — everyone else needs a paid commercial license, with no exemption for public-sector or non-profit organizations above that threshold. AutoImage wraps SkiaSharp (MIT licensed, Google's Skia graphics engine) behind a small, fluent, ImageSharp-like API for the operations most apps actually need, fully free for everyone regardless of revenue.
What AutoImage actually is
AutoImage is a thin fluent wrapper. It contains no image codec, resampling, or compositing logic of its own — every decode, resize, crop, and encode is performed by SkiaSharp. AutoImage only provides a small, chainable surface over it:
Loada file path or streamResizewithStretch,Fit(letterbox, preserves aspect ratio), orCover(crop-to-fill, like CSSbackground-size: cover)Cropto an explicit rectangleRotate90in 90-degree increments- Basic filters:
Grayscale,Blur,Sharpen,Brightness,Contrast,Saturate - Text and image watermarks
Saveto a file orToBytesin memory, encoding to Png, Jpeg, Webp, Bmp, or Gif
What AutoImage explicitly does NOT do
Arbitrary-angle rotation and advanced multi-layer compositing are not
implemented. These are exactly the areas where a thin wrapper stops adding
value over using SkiaSharp directly — if you need them, use SkiaSharp (or
SKCanvas/SKPaint) directly; AutoImage's AutoImageEditor does not hide
access to anything, but also doesn't attempt to wrap every SkiaSharp API.
Install
dotnet add package Swevo.AutoImage
Linux/macOS: SkiaSharp's managed package alone only ships Windows native binaries.
On Linux or macOS, also add the matching native asset package for your platform
(e.g. dotnet add package SkiaSharp.NativeAssets.Linux, or SkiaSharp.NativeAssets.macOS),
or use a base image that already provides libSkiaSharp.
Quick start
using AutoImage;
using var editor = AutoImageEditor.Load("input.jpg");
editor
.Resize(800, 600, AutoImageResizeMode.Cover)
.Brightness(0.1f)
.Saturate(1.2f)
.Watermark("© Swevo", AutoImageWatermarkPosition.BottomRight, opacity: 0.6f, fontSize: 28f)
.Save("output.png", AutoImageFormat.Png);
Working in memory (e.g. inside an API endpoint):
using var editor = AutoImageEditor.Load(uploadedFileStream);
editor.Resize(320, 320, AutoImageResizeMode.Fit);
byte[] thumbnail = editor.ToBytes(AutoImageFormat.Webp, quality: 80);
Rotating and cropping:
using var editor = AutoImageEditor.Load("photo.jpg");
editor
.Rotate90() // 90 degrees clockwise
.Crop(x: 0, y: 0, width: 500, height: 500);
Applying filters:
using var editor = AutoImageEditor.Load("portrait.jpg");
editor
.Blur(1.5f, 1.5f)
.Sharpen()
.Contrast(0.15f)
.Save("portrait-enhanced.jpg", AutoImageFormat.Jpeg, quality: 90);
Adding watermarks:
using AutoImage;
using SkiaSharp;
using var editor = AutoImageEditor.Load("photo.jpg");
using var logo = SKBitmap.Decode("logo.png");
editor
.Watermark("Draft", AutoImageWatermarkPosition.TopLeft, opacity: 0.35f, fontSize: 48f, color: SKColors.White)
.Watermark(logo, AutoImageWatermarkPosition.BottomRight, opacity: 0.85f, scale: 0.5f)
.Save("watermarked.png", AutoImageFormat.Png);
Or load the watermark image from a file path:
using var editor = AutoImageEditor.Load("photo.jpg");
editor
.WatermarkImage("logo.png", AutoImageWatermarkPosition.BottomRight, opacity: 0.85f, scale: 0.5f)
.Save("watermarked.png", AutoImageFormat.Png);
Resize modes
| Mode | Behavior |
|---|---|
Stretch |
Scales width/height independently to exactly match the target size (may distort aspect ratio). |
Fit |
Scales to fit entirely within the target size, preserving aspect ratio (result may be smaller than the target on one axis). |
Cover |
Crops to the target aspect ratio first, then scales to exactly fill the target size. |
Related Swevo packages
- FluentPdf — free QuestPDF alternative
- FluentExcel — free EPPlus alternative
- AutoAuth — free Duende IdentityServer alternative
License
MIT
| 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
- SkiaSharp (>= 2.88.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.1.0: Added Blur/Sharpen/Brightness/Contrast/Saturate filters plus text/image watermark support on AutoImageEditor, and updated README examples. 1.0.0: Initial release. Fluent AutoImageEditor with Load/Resize (Stretch/Fit/Cover)/Crop/Rotate90/Grayscale/Save/ToBytes over Png/Jpeg/Webp/Bmp/Gif, backed entirely by SkiaSharp.