Microsoft’s release of .NET Standard and .NET Core (two technologies that define cross-platform specification while providing a consistent set of APIs for application developers), encourages many application developers to automate their processes and migrate to .NET Standard. When working with images in .NET applications, developers are looking for imaging APIs that support this platform.
One solution is the open-source ImageSharp API that was released with an objective of providing an alternative to the System.Drawing APIs (that were missing in .NET Core and .NET Standard). This API is detailed and supports advanced algorithms for image processing. The API is being enhanced year by year to support more complex image processing.
Other Imaging APIs (licensed or free) that support .NET Standard are also emerging. These options offer alternatives, so developers can find the best API for their project requirements.
In this article, we’ll discuss features, imaging API use cases, and top reasons why you would want to choose to work with an imaging API.
Recently, we released Documents for Imaging, an imaging library that can create, load, modify and save images in .NET Core with full support on Windows, macOS, Linux, AWS Lambda and Azure Functions.
The library is a feature-rich API that can load images of popular formats like BMP, JPEG, TIFF, GIF and PNG, apply advanced image processing techniques and save them back. You can read/write images, modify images (like rotate, crop, resize, convert images). You can apply effects such as dithering and thresholding effects on grayscale images, as well as apply effects on RGB images. You can also draw and fill graphics on images, draw advanced text with full font handling, apply advanced TIFF features and much more.
GcImaging supports creating, editing, and saving TIFF images, the format preferred to store multiple raster images of different pixel depths.
The following features are supported when working with TIFF images:
ImageSharp does not currently support TIFF image formats.
GcImaging API adds advanced text features that can work accurately on any environment and in multilingual applications where the image is being used.
Here's a list of text features and properties supported with GcImaging:
ImageSharp's text rendering is limited to basic drawing only.
In addition to Imaging effects on RGB images like HueRotation, Saturation, TemperatureAndTint etc., GcImaging offers addition image processing features, for example, users can:
The above features are still yet to be supported by ImageSharp.
We conducted some tests to see how GcImaging performs when drawing graphics using paths and regions filled with solid brushes. This sample is based on a similar sample from Image Sharp which draws shapes.
Run this sample to compare the performance of GcImaging with ImageSharp:
Measurements suggest that GcImaging performs faster while drawing graphics on different sized images and filling regions, specially smaller regions. The tests were also performed with combination of SlowAntialiasing and Multithreaded modes.
For very large regions ImageSharp draws relatively fast; however, it is slower than GcImaging.
Note: Values may vary when the sample is run on different configurations.
What do you think about GcImaging in comparison with ImageSharp? Please leave your comments below.