Announcing ImageSharp.Web 1.0.0

It's time to celebrate the release of ImageSharp.Web 1.0.0!

ImageSharp.Web is 1.0.0! #

We are very excited to announce the release of ImageSharp.Web 1.0.0 final. You can download it today.

ImageSharp.Web is a high performance ASP.NET Core Middleware built on top of ImageSharp that allows the processing and caching of image requests via a simple API.

ImageSharp.Web is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional extensions to add image sources, caching mechanisms or even your own processing API.

What's New Since the RC #

We've added culture aware command processing, fine grained cache timing configuration options, the ability to set the quality of jpeg's and a new Azure Blob Storage provider and cache.

Oh and we made it fast... Real fast!

Quicksilver from the 'X-Men: Apocalypse' trailer

I'd like to take a moment here to give a massive shout out to Dean Marcussen and Sébastien Ros for providing code and benchmarks to help us really Crank up the speed. We're currently seeing 60,000 request/sec in our benchmarks!

You can see the full Release Notes in the repository.

Licensing. #

ImageSharp.Web and accompanying projects are released under the permissive Apache 2.0 license. This means that the library is open source and free to use but is released AS-IS with no support for issues or feature requests.

If you require support you should purchase a Support License otherwise you will need to submit pull requests against the repository.

Getting Started #

Installation #

Once you've installed the package from NuGet you will need to add the following code to ConfigureServices and Configure in your Startup.cs file.

This installs the the default service and options.

public void ConfigureServices(IServiceCollection services) {
    // Add the default service and options.
    services.AddImageSharp();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {

    // Add the image processing middleware.
    app.UseImageSharp();
}

The fluent configuration is flexible allowing you to configure a multitude of different options. For example you can add the default service and custom options.

// Add the default service and custom options.
services.AddImageSharp(
    options =>
        {
            options.BrowserMaxAge = TimeSpan.FromDays(7);
            options.CacheMaxAge = TimeSpan.FromDays(365);
        });

Or you can fine-grain control adding the default options and configure other services.

// Fine-grain control adding the default options and configure other services.
services.AddImageSharp()
        .RemoveProcessor<FormatWebProcessor>()
        .RemoveProcessor<BackgroundColorWebProcessor>();

Full Configuration API options are available here.

Processing Images #

The ImageSharp.Web processing API is imperative. This means that the order in which you supply the individual processing operations is the order in which they are are compiled and applied. This allows the API to be very flexible, allowing you to combine processes in any order.

It is possible to configure your own processing command pipeline by implementing and registering your own version of the IRequestParser interface.

The following processors are built into the middleware. In addition extension points are available to register you own command processors. All processing output is cached for future requests in a high performance intelligent cache which detects changes in source material. This storage mechanism for the cache can be replaced by any implementation you choose.

Resize

Allows the resizing of images.

{PATH_TO_YOUR_IMAGE}?width=300
{PATH_TO_YOUR_IMAGE}?width=300&height=120&rxy=30,30
{PATH_TO_YOUR_IMAGE}?width=50&height=50&rsampler=nearest&rmode=stretch

Format

Allows the encoding of the output image to a new image format. The available formats depend on your configuration settings.

{PATH_TO_YOUR_IMAGE}?format=jpg
{PATH_TO_YOUR_IMAGE}?format=gif
{PATH_TO_YOUR_IMAGE}?format=png
{PATH_TO_YOUR_IMAGE}?format=bmp
{PATH_TO_YOUR_IMAGE}?format=tga

Quality

Allows the encoding of the output image at the given quality.

  • For Jpeg this ranges from 1-100.
{PATH_TO_YOUR_IMAGE}?quality=90
{PATH_TO_YOUR_IMAGE}?format=jpg&quality=42

Only certain formats support adjustable quality. This is a constraint of individual image standards not the API.

Background Color

Allows the changing of the background color of transparent images.

{PATH_TO_YOUR_IMAGE}?bgcolor=FFFF00
{PATH_TO_YOUR_IMAGE}?bgcolor=C1FF0080
{PATH_TO_YOUR_IMAGE}?bgcolor=red
{PATH_TO_YOUR_IMAGE}?bgcolor=128,64,32
{PATH_TO_YOUR_IMAGE}?bgcolor=128,64,32,16

As you can see it's extremely powerful yet simple to use. You can find full Processing API options in our documentation.

The Future #

From a roadmap perspective we'll continue to bring usability and performance enhancements to ImageSharp.Web but the immediate focus will shift to bringing SixLabors.ImageSharp.Drawing, and SixLabors.Fonts development up to a production ready standard. Any and all assistance there would be greatly appreciated.

Closing #

Thanks again for all the feedback and usage. It’s been a pleasure to build ImagSharp.Web so far and to see so many people try it out; we really appreciate it. Please continue exploring the product and learning what it’s capable of.