Graphics/Rendering Libraries/APIs

The three rendering libraries on Linux (not X11 based) and can be used “stand-alone” are:

  • Cairo - used mostly by GDK/GTK+ based programs
  • Anti-Grain-Geometry (AGG) - none toolkit’s primary graphics kit in particular, but used by a number of programs and libraries (most notably plotting, like matplotlib)
  • pixman - used in the X11 server (but you can use it in your program, too)

When it comes to AGG vs. Cairo the biggest selling point for Cairo is, that it got a pure C binding. Unfortunately Cairo is not a very fast renderer (it made huge progress in the past 10 years). But it’s eating the dust of AGG, which is much faster and (ironically) also produces better quality; unfortunately AGG is a C++ library, so to effectively use it you’re bound to use C++, which is a downside. Also the principal developer of AGG sadly passed away a few years ago, which stalled development for some time, but it’s been picked up by the community again

One must also not forget the “raster” graphics engine in Qt, but that can be used only within Qt within QPainter (so stand-alone if your program uses Qt, but can’t be used without Qt).

Graphics Libraries - Types

  • OpenGL is to Vulkan
  • Direct3D 11 is to Direct3D 12

Library/API

Platform

Description

Cairo

ALL

  • is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers
  • it provides primitives for two-dimensional drawing across a number of different backends
  • uses hardware acceleration when available
  • written in C programming language
Link to original

Anti-Grain Geometry (AGG)

ALL

  • is a 2D rendering graphics library
  • is written in C++
  • it features anti-aliasing and sub-pixel resolution
  • it is not a graphics library, per se, but rather a framework to build a graphics library upon
Link to original

Pixman

ALL

  • is a low-level rendering library for pixel manipulation, providing features such as image compositing and trapezoid rasterization
  • important users of pixman are the cairo graphics library and the X server
  • is implemented as a library in the C programming language
  • it runs on many platforms, including Linux, BSD Derivatives, MacOS X, and Windows
Link to original

OpenGL

ALL

  • is a cross-language, cross-platform application programming interface for rendering 2D and 3D vector graphics
  • managed by Khronos Group
  • is being replaced with Vulkan
Link to original

Vulkan

ALL

  • is replacing OpenGL
  • offers higher performance and more balanced CPU/GPU usage than: OpenGL and Direct3D 11
  • comparable to Direct3D 12 and Metal
  • managed by Khronos Group
  • is derived from and built upon components of AMD’s Mantle API, which was donated by AMD to Khronos with the intent of giving Khronos a foundation on which to begin developing a low-level API that they could standardize across the industry
Link to original

Direct3D

Windows

  • is a Graphics API for Microsoft Windows
  • is part of Microsoft’s DirectX collection of APIs for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms
Link to original

Metal

MacOS
iOS

  • is a low-level, low-overhead hardware-accelerated compute shader3D graphic API
  • is developed by Apple
  • Metal exist just because Apple didn’t want to support Vulkan (however there is MoltenVK a runtime for macOS and iOS that offers an almost complete subset of the Vulkan API implemented using Metal)
Link to original