next generation 2d vector graphics engine

About Blend2D

Blend2D is a next generation 2D vector graphics engine written in C++. It has been engineered from scratch to provide maximum performance of software based 2D rendering. It features a built-in JIT compiler that generates efficient pipelines at runtime and a completely new rasterizer that is both efficient and provides high quality anti-aliasing. The future of Blend2D is to offer asynchronous and multithreaded rendering to make integration with event-based environments such as node.js and next generation UI toolkits seamless.

Modern C++ API and Bindings

Blend2D is written in C++ and provides modern and intuitive C++ API. The API was designed from scratch to be easy to use from C++ and easy to bind to other languages. As an example bindings for node.js are provided in a separate project called b2d.js. A minimal and self-explanatory source code comparision between C++ and JavaScript API is shown below.


  #include <b2d/b2d.h>

  b2d::Image render() {
    b2d::Image img(256, 256, b2d::PixelFormat::kIdPRGB32);
    b2d::Context2D ctx(img);

    b2d::LinearGradient linear(0, 0, 256, 256);
    linear.addStop(0.0, b2d::Argb32(0x00000000));
    linear.addStop(1.0, b2d::Argb32(0xFFFFFFFF));


    return img;

JavaScript API

  const b2d = require("b2d");

  function render() {
    const img = new b2d.Image(256, 256, "prgb32");
    const ctx = new b2d.Context2D(img);

    const linear = new b2d.LinearGradient(0, 0, 256, 256)
      .addStop(0.0, "#00000000")
      .addStop(1.0, "#FFFFFFFF");

    ctx.compOp = "src";
    ctx.fillStyle = linear;

    return img;

High Quality Rasterization

Blend2D features an analytic rasterizer that was written from scratch to deliver high performance and to provide the same quality as AGG and FreeType rasterizers. It's more efficient because it uses different data structures to accumulate cells during rasterization and to scan them during composition. It has stable memory footprint and performs rasterization and composition in bands instead of using a typical scanline-based approach. The rasterizer is robust and excels in rendering text and complex vector art.

Paint Styles

Blend2D provides similar paint styles as defined by SVG and HTML <canvas>, which include solid colors, gradients, and patterns. It uses a slot-based approach that allows to specify both fill and stroke styles separately. Gradients and patterns also support extend modes so it's possible to specify whether they should be padded, repeated, or reflected. Extend modes of patterns can be configured independently of X and Y.

Composition & Blending

Blend2D supports all Porter&Duff compositing operators and a wide range of blend modes defined by SVG, CSS, and PDF specifications. Composition and blending modes can be applied to any rendering operation including fills, strokes, and image blits.

Alpha and Beta Version

Blend2D is developed privately at the moment, but once ready the source code will be released under ZLIB license. There are two releases currently planned - private alpha and public beta. Private alpha will be distributed to people that are already in touch with Blend2D team and would like to participate in alpha testing. Public beta will be released 1-3 months after the alpha.

Alpha version will be provided to early adopters around April 2018 and anyone can participate. There are only two conditions - to not redistribute the source code to other parties and to not share any benchmarks until the beta version is officially out. There is no guarantee that the C++ API of alpha and beta versions will stay compatible with future versions. These versions are not for people that are looking for long-term API stability.

See Blend2D's roadmap for a high-level overview of planned features.

Support Blend2D

Blend2D started as a personal spare-time project to experiment with JIT compilation of 2D pipelines. The project has grown into a high-performance 2D rendering engine and its ambition is to outperform 2D rendering engines that are used today by taking advantage of JIT, SIMD, and multithreading.

The founder and lead developer of the Blend2D project is focusing solely on Blend2D and AsmJit projects - full-time and for free. This strategy is not feasible in the long term so the Blend2D project is looking for companies that can contribute financially or by allocating some of their development time to be spent on Blend2D (and optionally AsmJit if it's in their interest). It's possible that there will be more options available in the future (like paid support or pay-per-feature), but these will be decided after the beta is out.

Blend2D is not backed by any company at the moment and really needs your support. Be first!