Imageflow.AllPlatforms 0.12.0

The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved
dotnet add package Imageflow.AllPlatforms --version 0.12.0
NuGet\Install-Package Imageflow.AllPlatforms -Version 0.12.0
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="Imageflow.AllPlatforms" Version="0.12.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Imageflow.AllPlatforms --version 0.12.0
#r "nuget: Imageflow.AllPlatforms, 0.12.0"
#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.
// Install Imageflow.AllPlatforms as a Cake Addin
#addin nuget:?package=Imageflow.AllPlatforms&version=0.12.0

// Install Imageflow.AllPlatforms as a Cake Tool
#tool nuget:?package=Imageflow.AllPlatforms&version=0.12.0

Build status

Imageflow.NET is a .NET API for Imageflow, the fast image optimization and processing library for web servers. Imageflow focuses on security, quality, and performance - in that order. Imageflow.NET is a .NET 8.0 & .NET Standard 2.0 library, and as such is compatible with .NET 4.6.2+, .NET Core 2.0+, and .NET 5/6/7/8.

Note: We recently switched from Newtonsoft to System.Text.Json to support AOT and trimming; see for details and some breaking changes.

On .NET Core 3.x and .NET 5/6/7/8 (or if using PackageReference on .NET 4.x)

dotnet add package Imageflow.AllPlatforms

If you're still using packages.config on .NET 4.x (such as for ASP.NET projects), you have to install Imageflow directly

PM> Install-Package Imageflow.Net
PM> Install-Package -pre
PM> Install-Package -pre
PM> Install-Package Imageflow.NativeRuntime.osx-x86_64 -pre
PM> Install-Package Imageflow.NativeRuntime.ubuntu-x86_64 -pre

Note: On .NET 4.x you must install the appropriate NativeRuntime(s) in the project you are deploying - they have to copy imageflow.dll to the output folder. They are not copied transitively.

Also note: Older versions of Windows may not have the C Runtime installed (Install 32-bit or 64-bit).


  • Imageflow is dual licensed under a commercial license and the AGPLv3.
  • Imageflow.NET is tri-licensed under a commercial license, the AGPLv3, and the Apache 2 license.
  • Imageflow.NET Server is dual licensed under a commercial license and the AGPLv3.
  • We offer commercial licenses at
  • Imageflow.NET's Apache 2 license allows for integration with non-copyleft products, as long as jobs are not actually executed (since the AGPLv3/commercial license is needed when libimageflow is linked at runtime). This can allow end-users to benefit from optional imageflow integration in products.


Getting image dimensions and format

using Imageflow.Fluent;

public async void TestGetImageInfo()
    var imageBytes = Convert.FromBase64String(

    var info = await ImageJob.GetImageInfo(new BytesSource(imageBytes));
    Assert.Equal(info.ImageWidth, 1);
    Assert.Equal(info.ImageHeight, 1);
    Assert.Equal(info.PreferredExtension, "png");
    Assert.Equal(info.PreferredMimeType, "image/png");

Edit images with the fluent API

using Imageflow.Fluent;
public async Task TestAllJob()
    var imageBytes = Convert.FromBase64String(
    using (var b = new ImageJob())
        var r = await b.Decode(imageBytes)
            .CropWhitespace(80, 0.5f)
            .Distort(30, 20)
            .Region(-5,-5,10,10, AnyColor.Black)
            .RegionPercent(-10f, -10f, 110f, 110f, AnyColor.Transparent)    
            .FillRectangle(2,2,8,8, AnyColor.Black)
            .ConstrainWithin(5, 5)
            .Watermark(new BytesSource(imageBytes), 
                new WatermarkOptions()
                        new WatermarkMargins(WatermarkAlign.Image, 1,1,1,1), 
                        new ConstraintGravity(90,90))
                    .SetHints(new ResampleHints().SetSharpen(15f, SharpenWhen.Always))
            .EncodeToBytes(new MozJpegEncoder(80,true))

        Assert.Equal(5, r.First.Width);

Generate multiple versions of one image

using Imageflow.Fluent;
public async Task TestMultipleOutputs()
    using (var b = new ImageJob())
        var r = await b.Decode(imageBytes).
            Constrain(new Constraint(ConstraintMode.Fit, 160, 120))
            .Branch(f => f.ConstrainWithin(80, 60).EncodeToBytes(new WebPLosslessEncoder()))
            .Branch(f => f.ConstrainWithin(40, 30).EncodeToBytes(new WebPLossyEncoder(50)))
            .EncodeToBytes(new LodePngEncoder())

        Assert.Equal(60, r.TryGet(1).Width);
        Assert.Equal(30, r.TryGet(2).Width);
        Assert.Equal(120, r.TryGet(3).Width);


Edit images using a command string

using Imageflow.Fluent;

public async Task TestBuildCommandString()
    var imageBytes = Convert.FromBase64String(
    // We wrap the job in a using() statement to free memory faster
    using (var b = new ImageJob())
        var r = await b.BuildCommandString(
            new BytesSource(imageBytes), // or new StreamSource(Stream stream, bool disposeStream)
            new BytesDestination(), // or new StreamDestination

        Assert.Equal(3, r.First.Width);
        Assert.Equal("webp", r.First.PreferredExtension);

More examples are in the tests

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Imageflow.AllPlatforms:

Package Downloads

The Enterprise Web Library (EWL), together with its tailored infrastructure platform, is a highly opinionated foundation for web-based enterprise software.

Imageflow.Server The ID prefix of this package has been reserved for one of the owners of this package by

Imageflow.Server - Middleware for fetching, processing, and caching images on-demand. Commercial licenses available.


RAD Framework for the IAM stack

ImageResizer.Plugins.Imageflow The ID prefix of this package has been reserved for one of the owners of this package by

Fast image processing and compression backend for the ImageResizer HttpModule.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Imageflow.AllPlatforms:

Repository Stars
The official repository for ImageResizer
A super-fast image server to speed up your site - deploy as a microservice, serverless, or embeddable.
Version Downloads Last updated
0.12.0 1,908 2/6/2024
0.11.2 396 1/29/2024
0.11.1 70 1/29/2024
0.11.0 73 1/29/2024
0.10.2 27,447 9/26/2023
0.10.0 32,353 4/4/2023
0.9.1 52,104 1/6/2023
0.9.0 20,864 9/30/2022
0.8.5 5,812 8/26/2022
0.8.4 2,458 8/7/2022
0.8.3 23,893 8/4/2022
0.8.2 20,211 6/9/2022
0.8.1 6,873 5/21/2022
0.8.0 510 5/20/2022
0.7.31 983 5/19/2022
0.7.24 162,730 3/29/2021
0.7.23 1,607 3/18/2021
0.7.22 3,433 3/18/2021