ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββββββ ββββ ββββββ βββββββ ββββββββ β
β ββββββββ βββββββββββββββββββββ ββββββββ β
β βββββββββββββββββββββββββ ββββββββββ β
β βββββββββββββββββββββββββ βββββββββ β
β ββββββ βββ ββββββ ββββββββββββββββββββ β
β ββββββ ββββββ βββ βββββββ ββββββββ β
β β
β P R O C E S S O R Β· C O R E β
β β
β Fluent image processing β built on .NET, runs anywhere β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
You have an image. You want this:
ββββββββββββββββ ββββββββββββββββ
β raw photo β ββββββββββββββΊ β processed β
β ugly size β one fluent chain β watermarked β
β no watermarkβ β resized β
β wrong formatβ β PNG / WEBP β
ββββββββββββββββ ββββββββββββββββ
Standard .NET gives you this:
var bmp = new Bitmap(file);
var g = Graphics.FromImage(bmp);
g.DrawImage(...); // resize β 20 lines
g.DrawString(...); // watermark β 15 lines
bmp.Save(file, codec); // format β 10 more lines
ImageProcessor.Core gives you this:
new ImageFactory()
.Load(file)
.Resize(new ResizeLayer(800, 600))
.Watermark(new TextLayer { Text = "Β© Me" })
.Format(new PngFormat())
.Save(output); // done. 6 lines.
One library. Fluent API. No ceremony. Stop wiring
Graphics,ImageCodecInfo, andEncoderParametersby hand. Every operation is a single chained call β readable, testable, and composable.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ImageFactory β
β β
β Load βββ¬ββ Resize ββββ Crop ββββ Rotate ββ Save β
β β β
β βββ Filters ββ¬β GaussianBlur β
β β ββ GaussianSharpen β
β β ββ DetectEdges β
β β ββ Gray / Binary / Halftone β
β β ββ Tint / Vignette / Hue β
β β β
β βββ Adjust βββ¬β Brightness / Contrast β
β β ββ Saturation / Gamma β
β β ββ Alpha / ReplaceColor β
β β ββ Resolution / Quality β
β β β
β βββ Compose ββ¬β Watermark (text) β
β β ββ Overlay (image on image) β
β β ββ Mask β
β β ββ Background / BackgroundColor β
β β β
β βββ Special ββ¬β Mosaic (pixelated region) β
β β ββ Pixelate β
β β ββ RoundedCorners β
β β ββ EntropyCrop (smart crop) β
β β ββ ClearNoise / ClearBackground β
β β ββ Flip / AutoRotate / Scale β
β β β
β βββ Format βββ¬β JPEG / PNG / GIF / BMP β
β ββ (preserves animation in GIF) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
dotnet add package ImageProcessor.Core.CoreCompatOr via Package Manager:
Install-Package ImageProcessor.Core.CoreCompatusing ImageProcessor;
using ImageProcessor.Imaging;
using ImageProcessor.Imaging.Formats;
// Resize + sharpen + save as PNG
using var factory = new ImageFactory();
factory.Load("input.jpg")
.Resize(new ResizeLayer(1280, 720))
.GaussianSharpen(5)
.Format(new PngFormat())
.Save("output.png");// Mosaic (pixelate) a region β great for censoring faces / text
factory.Load("screenshot.png")
.Mosaic(new MosaicLayer(x: 100, y: 50, width: 200, height: 80,
size: new Size(10, 10)))
.Save("censored.png");// Add a watermark
factory.Load("photo.jpg")
.Watermark(new TextLayer
{
Text = "Β© My Company",
FontSize = 24,
Position = new Point(20, 20),
Opacity = 80
})
.Save("photo_watermarked.jpg");// Chain multiple operations
factory.Load("raw.gif")
.AutoRotate()
.Resize(new ResizeLayer(800, 600, ResizeMode.Crop))
.Brightness(10)
.Contrast(5)
.Quality(85)
.Save("final.gif"); // GIF animation preserved Original image After Mosaic(x:450, y:280, w:140, h:50)
βββββββββββββββββββ βββββββββββββββββββ
β β β β
β [face here] β β [ββββββββββ] β β pixelated block
β β β β
βββββββββββββββββββ βββββββββββββββββββ
factory.Load("photo.gif")
.Mosaic(new MosaicLayer(450, 280, 140, 50, new Size(10, 10)))
.Save("photo_censored.gif"); ββββββββββββ
file/streamβ β
βββββββββββΊ β .Load() β
ββββββ¬ββββββ
β Image + Format detected
βΌ
ββββββββββββββββββ
β Processor chainβ βββ each .Method() enqueues a processor
β [ P1, P2, P3 ]β
ββββββββββ¬ββββββββ
β applied in order
βΌ
ββββββββββββ
β .Save() ββββββββΊ file / stream
ββββββββββββ
Each processor implements IGraphicsProcessor β you can also add your own:
public class MyProcessor : IGraphicsProcessor
{
public Image ProcessImage(ImageFactory factory)
{
// manipulate factory.Image
return factory.Image;
}
}
factory.Load("img.png")
.ApplyProcessor(new MyProcessor())
.Save("out.png");| Framework | Support | Notes |
|---|---|---|
| .NET Standard 2.0 | β | .NET Framework 4.6.1+, .NET Core 2.0+ |
| .NET 8 (Windows) | β | Uses native GDI+ via System.Drawing.Common |
| .NET 9 (Windows) | β | Uses native GDI+ via System.Drawing.Common |
System.Drawing.Commonis Windows-only on .NET 6+. This library targetsnet8.0-windowsandnet9.0-windowsfor modern .NET to make that constraint explicit and safe.
PRs and issues welcome. Please open an issue before submitting large changes.
Apache License 2.0 β originally by James Jackson-South, extended here with additional processors (Mosaic, ClearNoise, Binary, etc.).