Computer Graphics

The Computer Graphics toolbox works with pixel images: photos, screenshots and pictures you generate. You can load, create and save images in common formats, adjust and filter them (blur, contrast, edge detection, dithering), place images on each other, draw shapes and text, convert between panoramas and cube maps, tone-map HDR images, and view them side by side. It also writes text with stroke fonts, which draw each letter the way a pen moves.

This toolbox is about 2D images. It is not the Computer Graphics workload in Divooka Compute, which is about 3D scenes; that workload's nodes are in 3D Staging, Gaussian Splatting and the other 3D toolboxes.

Use it for batch photo work, image analysis such as finding edges, or pictures made from code.

  • Included in: Divooka Explore and Divooka Compute Standard. In Compute, start a document from the Image Processing workload, or add the Image Processing reference with Add reference (Ctrl+Shift+L). The Image Processing reference holds Computer Graphics, Procedural Materials and Utilities.
  • Maturity: Stable · Support: Tier 1 (proposed) · what these mean
  • Open it: node library (Ctrl+Shift+Space) → Computer Graphics, or search for a node with Ctrl+Space.
  • Examples and reference: Ctrl+Shift+E → Image Processing (3 examples) and Computer Graphics (5 examples) · node reference

New to graphs? Start with Your first program.

Main ideas

A Pixel Image is the value on the wire. Most nodes take a Pixel Image and return a new one. There are also HDR images (floating-point color) and 16-bit grayscale images for heightmaps and masks.

Colors are values too. The Media Colors category has every named web color, such as Cornflower Blue; Make Color builds one from numbers.

Stroke fonts write, they do not stamp. A stroke font stores each letter as the marks a pen makes, in order. Write Text can stop partway, so a row of Write Text nodes with growing Progress is an animation of a word being written.

Example: handwriting

The task: write the word Divooka by hand, show it half written, and measure it.

Open Image Processing > Handwriting (Ctrl+Shift+E). It is a Routine graph:

  1. Write Text, Text Divooka, Cap Height 72, Font the Script stroke font, Background Color White.
  2. A second Write Text with the same settings and Progress 0.5 stops the pen halfway.
  3. A third Write Text uses the Print font, an upright face.
  4. Two Measure nodes report how wide the ink is.

The three pictures, and the console:

The word Divooka written in a cursive script, the same word stopped halfway at Divo, and the word in an upright print face

In Hershey Script, Divooka is 353 pixels of ink.
In Hershey Roman Simplex, it is 408 pixels.

Example: find the edges in a picture

Open Image Processing > Edge Detection (Canny). It is a Flows graph:

  1. Get Library Image, Path /Screenshot.jpg, reads a picture stored in the document.
  2. Canny (Edge Detection), Low Threshold 120, High Threshold 300, finds the edges: white lines on black.
  3. Mix, Function Enum Add, adds the edges onto the original picture, and a Preview shows the result.

To use your own picture: add it to the document's asset library and change the path, or read a file from disk with an image loading node. Lower the thresholds to find fainter edges.

More examples to open

Example What it shows
Image Processing > Cube Map Creation A panorama turned into a cube map and back
Computer Graphics > Basic Shapes Shapes, text and simple 3D solids drawn as images
Computer Graphics > Distance Fields An outline turned into a mask
Computer Graphics > Painting Program A picture drawn by a chain of drawing commands
Computer Graphics > Raytracer A 3D scene ray traced into a window

Tips and limits

  • Save writes PNG. For BMP, GIF, ICO, JPEG, QOI, TGA, WebP and portable map formats, use the Save As nodes.
  • Three stroke fonts are built in: Script, Script Complex and Print (Hershey Script, Hershey Script Complex and Hershey Roman Simplex). From File loads another stroke font from a Hershey .jhf file.
  • For one-step edits, see Utilities. Crops, vignettes and photo styles that need one node are in Utilities.
  • For tiling textures, see Procedural Materials. Its textures tile without seams and turn into materials.

Goes well with: Utilities, Procedural Materials, Library Assets for sample pictures.

What is in the toolbox

Category Some of its nodes
Media Colors Alice Blue, Antique White, Aqua, Aquamarine and 149 more
Pixel Image Make Pixel Image, Clone, Columns, Item and 57 more
Image Processing Routines Adjust Brightness, Adjust Contrast, Adjust Saturation, Apply Color Ramp and 40 more
HDR Pixel Image Make HDR Pixel Image, Clone, Columns, Item and 42 more
Color Alpha, Blue, Green, Red and 42 more
16-bit Grayscale Image Max Value, Min Value, Make 16-bit Grayscale Image, Clone and 41 more
Painting Program Make Painting Program, Clear, Draw Arrow, Draw Circle and 23 more
Procedural Texture Generator Convert Sample Coordinates, Create Bark (Wood Plank), Create Billow Pattern, Create Brick Texture and 39 more
Image Processing Filters Adaptive Threshold, Bilateral Filter, Canny (Edge Detection), Clahe and 34 more
Simple Shape Images Draw Circle Shape, Draw Cone Geometry, Draw Cube Geometry, Draw Cuboid Geometry and 19 more
Color Ramp Default Heat Ramp, Default Terrain Ramp, Natural Cool, Natural Dirt and 16 more
Vector 2D X, Y, Zero, Make Vector 2D and 13 more
Nib Fountain Pen, Pencil, Make Nib, Angle and 6 more
Stroke Font Baseline Unit, Cap Height, Characters, Is Cursive and 10 more
Color Stop Make Color Stop, Deconstruct, Equals, Color and 5 more
Pixel Image Factory Fill Image, Fill Pixel Image With Color, Generate Domain Warped Noise Image, Generate Fractal Noise Color Image and 4 more
Custom Data Array Entries Create Boolean Arrays, Create Double Number Arrays, Create Floating Number Arrays, Create Integer Number Arrays and 3 more
Pixel Image Editor Enhancement Annotate Image Function Signature, Created Image Data Name, Create Image Function Signature, Make Pixel Image Editor Enhancement and 2 more
Data Entry Curves Change Shape Size, Draw Shape, Draw Shapes
Tone Mapper To Pixel Image (Drago), To Pixel Image (Durand), To Pixel Image (Mantiuk), To Pixel Image (Reinhard)
Image Converter Convert ICO, Convert Image, Save As
Interactive Image Viewers Make Interactive Image Viewers, Show AB Image Viewer, Show Simple Image Viewer, Show Technical Image Viewer
Image Composer Compose Images, Configure Composition, Place Image
Stroke Pen Path Measure, Trace, Trace Glyph
Stroke Writing Measure Ink, Write Text, Write Text Onto
Shape Operations Fractal Breakup

See also