Code Screenshots With silicon

Turn a source file into a syntax-highlighted PNG for docs or slides.

macOSScreenshottextimageLow risk
Run silicon main.rs -o out.png to write a rendered code image.

01Command

Command
$ silicon main.rs -o out.png

02What it does

silicon uses syntect to highlight a file and renders it with optional window decorations, shadows, line numbers and themes, producing images suitable for blog posts and presentations. It can also read from standard input and output to the clipboard.

03Risk

RiskLow risk
CompatibilitymacOS with Homebrew installed
!Warning: Rendering needs a font that contains the glyphs you use; missing fonts can distort the output.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Homebrew formula: silicon
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Create beautiful image of your source code. Packages silicon, a tool that renders source code into syntax-highlighted images.
  • Official project documentation
    Official project · vendor-doc · 2026-09-20
    Evidence: Packages silicon, a tool that renders source code into syntax-highlighted images.

Last verified: 2026-09-22 · Category: Media

06Related solutions