Apache POI

ImageSharp

 
 

Open Source C# .NET Library for 2D Graphics

Read, Write, Modify, Resize & Convert PNG, JPEG, GIF & TIFF Images using .NET API.

 

ImageSharp is a simple yet very powerful cross-platform open source library for the processing of image files inside C# applications. It is a fully managed and cross-platform 2D graphics API designed to permit the processing of images. ImageSharp is an open source image processing library that was released with the goal of providing an alternative to the System.Drawing APIs.

This API is comprehensive and supports advanced algorithms for image processing. The API is improved year by year to provide support for more advanced image processing. Its only dependency is .NET itself, which makes it extremely portable. The API has included support for advanced features like image resizing, image encoding and decoding, decode image metadata only,  image cloning, Draw watermark on the image, Draw text along a path and many more.

Getting Started with ImageSharp

A Stable release is available on NuGet For beta versions, make sure that the Include Prerelease switch is enabled. Development releases are available via MyGet.

Install ImageSharp via Nuget

Install-Package SixLabors.ImageSharp -Version number 
You can also install it manually; download the latest release files directly from the  GitHub repository.

C# API to Resize Images

The ImageSharp library allows C# .NET programmers to resize images inside their own .NET applications. Resizing an image requires the process of generating and iterating through the pixels of a target image and sampling areas of a source image to choose what color to implement for each pixel. You can easily set the algorithm when processing images, such as Bicubic, Hermite, Box, CatmullRom, Lanczos2 and more.   Apart from the basic resizing operations, ImageSharp also offers more advanced features.

Free C# API to Resize Images

// Load File 
using (Image image = Image.Load("fileformat.jpg"))
{
    // Resize file 
    image.Mutate(x => x
            .Resize(image.Width / 2, image.Height / 2)
            .Grayscale());
    // Save
    image.Save("fileformat_out.jpg");
}                                
                                    

Draw Watermark on Image

Usually, people protect their images by putting a large watermark overlaid to preventing people from using the images without authorization. The ImageSharp library provides support for adding watermark to images inside C++ applications. To start you need a font family and you can easily get one from the system font store. Drawn the text over the image & grey it with 50% opacity.

Draw Text Along a Path

The ImageSharp library allows C# .NET developer to draw some text following the contours of a path. It is recommended to create a font collection. First, let’s generate the text as a set of vectors drawn along the path. After drawing the path so we can see what the text is supposed to be following.