A fluent, chainable API wrapper for System.Drawing.Common.
Resize, crop, watermark, mosaic, filter — in a single readable chain.
No GDI+ plumbing required.
var bmp = new Bitmap(file);
var g = Graphics.FromImage(bmp);
// resize — find the codec, set the params...
var codecInfo = GetEncoder(ImageFormat.Jpeg);
var encoderParams = new EncoderParameters(1);
encoderParams.Param[0] = new EncoderParameter(
Encoder.Quality, 85L);
// watermark — create font, brush, layout...
var font = new Font("Arial", 24, FontStyle.Bold);
var brush = new SolidBrush(Color.FromArgb(180,255,255,255));
g.DrawString("© Me", font, brush, new PointF(20,20));
bmp.Save(output, codecInfo, encoderParams);
new ImageFactory()
.Load(file)
.Resize(new ResizeLayer(1280, 720))
.Watermark(new TextLayer { Text = "© Me" })
.Quality(85)
.Save(output); // ✓ done
HOW IT WORKS
Each call enqueues a processor — applied in order, then flushed on Save().
Every common image operation — composable, chainable, zero boilerplate.
Resize, Crop, EntropyCrop, Rotate, RotateBounded, Flip, AutoRotate, Scale. Supports crop anchors, resize modes (pad, stretch, crop).
Brightness, Contrast, Saturation, Hue, Gamma, Alpha, Tint, ReplaceColor. Fine-tune every pixel with integer or percentage values.
GaussianBlur, GaussianSharpen, DetectEdges, Gray, Binary, Halftone, Vignette, Pixelate, Mosaic — including region-specific censoring.
Watermark (text), Overlay (image-on-image), Mask, Background, BackgroundColor, ClearBackground. Opacity and position control.
JPEG, PNG, GIF (animation preserved), BMP. Control output quality, resolution (DPI), and metadata (EXIF preserve / strip).
Implement IGraphicsProcessor and call
.ApplyProcessor(new MyProcessor()).
Plug custom operations into the same fluent chain.
using ImageProcessor;
using ImageProcessor.Imaging;
using ImageProcessor.Imaging.Formats;
// Load → resize → sharpen → save as PNG
using var factory = new ImageFactory();
factory.Load("input.jpg")
.Resize(new ResizeLayer(1280, 720, ResizeMode.Crop))
.GaussianSharpen(5)
.Format(new PngFormat())
.Save("output.png");
// Pixelate / censor a rectangular region of the image.
// Great for redacting faces, licence plates, or text.
using var factory = new ImageFactory();
factory.Load("screenshot.png")
.Mosaic(new MosaicLayer(
x: 100,
y: 50,
width: 200,
height: 80,
size: new Size(10, 10))) // block size
.Save("censored.png");
// Overlay a semi-transparent text watermark
using var factory = new ImageFactory();
factory.Load("photo.jpg")
.Watermark(new TextLayer
{
Text = "© My Company 2025",
FontSize = 28,
Position = new Point(20, 20),
Opacity = 75, // 0–100
DropShadow = true
})
.Quality(90)
.Save("photo_watermarked.jpg");
// Chain as many operations as you need —
// they are applied in order on a single decode/encode cycle.
using var factory = new ImageFactory(preserveExifData: true);
factory.Load("raw.gif") // auto-detects format
.AutoRotate() // correct EXIF orientation
.Resize(new ResizeLayer(800, 600, ResizeMode.Crop,
AnchorPosition.Center))
.Brightness(8)
.Contrast(5)
.Saturation(10)
.GaussianSharpen(3)
.Quality(85)
.Save("final.gif"); // GIF animation frames preserved
// Plug your own logic into the same pipeline
public class InvertProcessor : IGraphicsProcessor
{
public dynamic DynamicParameter { get; set; }
public Dictionary<string, string> Settings { get; set; } = new();
public Image ProcessImage(ImageFactory factory)
{
Bitmap bmp = (Bitmap)factory.Image;
// ... invert pixels ...
return bmp;
}
}
// Use it just like any built-in processor
factory.Load("img.png")
.ApplyProcessor(new InvertProcessor())
.Save("inverted.png");
dotnet add package ImageProcessor.Core.CoreCompat
Install-Package ImageProcessor.Core.CoreCompat
<PackageReference Include="ImageProcessor.Core.CoreCompat" Version="2.*" />
System.Drawing.Common is Windows-only on .NET 6+.
The net8.0-windows / net9.0-windows targets make that constraint explicit —
no surprise runtime errors.
One package. Fluent API. Every image operation you need.