grap2graph(1)

✨ grap2graph(1) β€” convert a grap diagram into a cropped image ✨

okay bestie, welcome to the General Commands Manual πŸ’– this page is all about grap2graph, and she is genuinely so good at turning a grap diagram into a cropped image. no cap.

🌸 NAME 🌸

grap2graph β€” convert a grap diagram into a cropped image

✨ SYNOPSIS ✨

grap2graph [-unsafe] [-format output-format] [convert-argument ...]

grap2graph --help

grap2graph -v

grap2graph --version

πŸ’… DESCRIPTION πŸ’…

grap2graph reads a grap(1) program from the standard input and writes an image file β€” by default in Portable Network Graphics (PNG) format β€” to the standard output. that's the main plot, and she ate. πŸŽ€

quick vibe check on the input: the GRAP code should not be wrapped with the .G1 and .G2 macros that normally guard it within groff(1) documents. leave those at home, bestie. 🫢

Arguments that grap2graph doesn't recognize get passed straight to the ImageMagick or GraphicsMagick program convert(1). by specifying these, you can give your image a border, set the image's pixel density, or perform other useful transformations. slay. πŸ’…

The output image is clipped using convert's -trim option to the smallest possible bounding box that contains all the black pixels. iconic cropping behavior, honestly. ✨

πŸŽ€ OPTIONS πŸŽ€

--help displays a usage message, while -v and --version show version information; all exit afterward. they're like, done after that. πŸ‘‹

  • --help β€” displays a usage message, then exits afterward
  • -v, --version β€” show version information, then exit afterward
  • -format output-format β€” write the image in output-format, which must be understood by convert; the default is PNG
  • -unsafe β€” run groff in unsafe mode, enabling the PIC command sh to execute arbitrary Unix shell commands; the groff default is to forbid this ⚠️
-unsafe is literally named that for a reason, bestie: it lets PIC's sh command execute arbitrary Unix shell commands. only use it if you know what you're doing. 🚨

πŸŒ€ ENVIRONMENT πŸŒ€

These environment variables are searched in the order shown to determine the directory where temporary files will be created:

  • GROFF_TMPDIR β€” checked first
  • TMPDIR β€” checked second
  • TMP β€” checked third
  • TEMP β€” checked fourth

If none are set, /tmp is used. 🫑

πŸ‘‘ AUTHORS πŸ‘‘

grap2graph was written by Eric S. Raymond, based on a recipe for pic2graph(1), by W. Richard Stevens. king behavior from both of them. πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, bestie:


this page is from groff 1.24.2, dated 2026-10-01. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from