Comparing Image Processing APIs on .NET Core (GcImaging vs ImageSharp)

GcImaging vs. ImageSharp on .NET Core

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.

GrapeCity Documents for 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.

Comparing GcImaging vs. ImageSharp

Working with TIFF images

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:

  • Read and write TIFF frames as separate images
  • Support various compression schemes
  • Support PhotometricInterpretation tag values WhiteIsZero, BlackIsZero, RGB, RGB Palette, and transparency mask
  • Support tiled, planar, and differencing storage methods

ImageSharp does not currently support TIFF image formats.

Drawing text on images

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:

  • Powerful text layout engine with full support for TrueType, OpenType, WOFF fonts
  • Text processing, layout and formatting is platform-independent and follows Unicode standards
  • Fallback, linked and EUDC fonts are fully supported
  • Draw colored fonts and characters with 4-byte Unicode codes
  • Font features and bold/italic emulation are supported
  • Right-to-left and Far Eastern languages are fully supported, including Kashida in Arabic and Tate Chu Yoko for CJK languages and vertical text
  • Various paragraph formatting options, support for multi-column text with balanced columns
  • Measure and split text
  • Draw text around images or other rectangular areas
  • Aliased and two anti-aliasing modes for rendering text and graphics

ImageSharp's text rendering is limited to basic drawing only.

Other Advanced Image processing Features

In addition to Imaging effects on RGB images like HueRotation, Saturation, TemperatureAndTint etc., GcImaging offers addition image processing features, for example, users can:

  • Apply bi-level or half-tone transparency mask to an image
  • Set the background color for a semi-transparent image (making the image opaque)
  • Check whether an image has transparent pixels
  • Get the list of unique pixel colors in the image (possible to load pixels, unique not sure)
  • Draw images with various alignment, tiling, opacity, and interpolation modes
  • Combine regions with logical operations, like OR, AND, XOR

The above features are still yet to be supported by ImageSharp.

Drawing Performance

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.

System Configuration:

  • Processor: i7-3610QM CPU 2.30 GHz with 6 GB RAM
  • Operating System: Windows 10 Pro Version 1809
  • Technology: .NET Core 2.1


Run this sample to compare the performance of GcImaging with ImageSharp:

GcImaging vs. ImageSharp Results:

GcImaging vs. ImageSharp on .NET Core

GcImaging vs. ImageSharp on .NET Core

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.

Shilpa Sharma

Product Manager
comments powered by Disqus