displaydrivers(1)

✨ Display drivers ✨

okay bestie, so displaydrivers is your little guide to how GRASS GIS draws stuff 💅 — and the way rendering works right now is direct rendering into a file. no drama, no ancient X11 nonsense, just pixels into a file. the driver gets picked either by setting the GRASS_RENDER_IMMEDIATE variable or by running the d.mon module. that's it, that's the vibe check.

here's the roster of display drivers you can choose from 👑:

  • Cairo driver
  • PNG driver
  • PS driver (Postscript, yes she's giving print-shop energy 🖨️)
  • HTMLMAP driver

🌸 NOTES 🌸

GRASS_RENDER_COMMAND

so if the environment variable GRASS_RENDER_COMMAND is defined, the display library redirects rendering to whatever external command you put in that variable. heads up though: currently only Python scripts are supported. no cap, that's the limit 🙈.

let's start with a simple example of a Python script called render.py:

#!/usr/bin/env python3
import os
import sys
import grass.script as gs
from grass.script import task as gtask
os.environ[’GRASS_RENDER_IMMEDIATE’] = ’default’
os.environ[’GRASS_RENDER_FILE’] = ’output.png’
cmd, dcmd = gtask.cmdstring_to_tuple(sys.argv[1])
gs.run_command(’d.text’, text="Test of GRASS_RENDER_COMMAND redirection")
os.environ[’GRASS_RENDER_FILE_READ’] = ’TRUE’
gs.run_command(cmd, **dcmd)

then after you define the GRASS_RENDER_COMMAND variable (this example is for Bash, bestie):

export GRASS_RENDER_COMMAND=render.py

and now GRASS modules like d.rast or d.vect will be executed by the render.py program instead. like, the whole thing reroutes through your script, iconic ✨. for example the command

d.vect roadsmajor

produces an output PNG file output.png which will contain the rendered features from the vector map roadsmajor plus the sample text "Test of GRASS_RENDER_COMMAND redirection". chef's kiss 🎀.


💖 SEE ALSO 💖

  • d.mon
  • variables

🦋 SOURCE CODE 🦋

Available at: Display drivers source code (history)

Accessed: Friday Nov 21 14:02:57 2025

Main index | Display index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page, bestie 🫶 this was GRASS 8.4.2, the displaydrivers(1) page from the GRASS GIS User's Manual — go render something gorgeous, you've got this 💜✨

📦 where this page comes from