Skip to main content
QUICK REVIEW

[Paper Review] Differentiable Drawing and Sketching

Daniela Mihai, Jonathon Hare|arXiv (Cornell University)|Mar 30, 2021
Advanced Vision and ImagingComputer Science36 references9 citations
TL;DR

This paper introduces a differentiable rasterization method for drawing primitives—points, lines, and curves—by reformulating pixel rendering via distance transforms and relaxing them for end-to-end learning. The approach enables direct optimization of sketches from images and unsupervised vectorization of handwritten digits, demonstrating strong performance in differentiable drawing and sketching tasks through a bottom-up, physically plausible composition framework.

ABSTRACT

We present a bottom-up differentiable relaxation of the process of drawing points, lines and curves into a pixel raster. Our approach arises from the observation that rasterising a pixel in an image given parameters of a primitive can be reformulated in terms of the primitive's distance transform, and then relaxed to allow the primitive's parameters to be learned. This relaxation allows end-to-end differentiable programs and deep networks to be learned and optimised and provides several building blocks that allow control over how a compositional drawing process is modelled. We emphasise the bottom-up nature of our proposed approach, which allows for drawing operations to be composed in ways that can mimic the physical reality of drawing rather than being tied to, for example, approaches in modern computer graphics. With the proposed approach we demonstrate how sketches can be generated by directly optimising against photographs and how auto-encoders can be built to transform rasterised handwritten digits into vectors without supervision. Extensive experimental results highlight the power of this approach under different modelling assumptions for drawing tasks.

Motivation & Objective

  • To develop a differentiable, bottom-up approach to rasterizing drawing primitives like points, lines, and curves.
  • To enable end-to-end optimization of sketches by relaxing rasterization through distance transforms.
  • To model compositional drawing processes that reflect physical drawing realities rather than graphics pipeline constraints.
  • To demonstrate sketch generation by optimizing against photographs and unsupervised vectorization of handwritten digits.
  • To provide a flexible, learnable foundation for differentiable drawing in deep learning and vision applications.

Proposed method

  • Redefine pixel rasterization of a primitive as a function of its distance transform to enable differentiability.
  • Relax the distance transform to allow gradient-based optimization of primitive parameters such as position, angle, and shape.
  • Use a differentiable composition mechanism to stack primitives in a way that mimics real drawing processes.
  • Integrate the differentiable primitives into neural networks for end-to-end training.
  • Apply the framework to both optimization-based sketch generation and auto-encoding vector representations of raster images.
  • Leverage the differentiability to train models without supervision for tasks like digit vectorization.

Experimental results

Research questions

  • RQ1Can rasterization of basic drawing primitives be made differentiable through a geometric relaxation of the distance transform?
  • RQ2How can differentiable drawing primitives be composed to model realistic, layered drawing processes?
  • RQ3Can end-to-end optimization of sketches be achieved by directly minimizing reconstruction loss against target images?
  • RQ4To what extent can unsupervised auto-encoders learn meaningful vector representations of handwritten digits using only differentiable rasterization?
  • RQ5How does the bottom-up, geometry-based approach compare to traditional graphics or neural rendering in sketch-related tasks?

Key findings

  • The proposed differentiable rasterization enables direct optimization of sketches from photographs, producing plausible and detailed line drawings.
  • Unsupervised auto-encoders trained with the differentiable primitives successfully reconstruct vectorized representations of MNIST digits without any ground-truth vector supervision.
  • The method supports end-to-end training of deep networks where primitive parameters are optimized via backpropagation.
  • The framework allows for compositional drawing with realistic layering and blending, reflecting physical drawing behavior.
  • Extensive experiments show the approach generalizes across different modeling assumptions and achieves strong results in sketch generation and vectorization.
  • The distance transform relaxation enables stable gradients even for non-smooth primitives like lines and corners.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.