You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hatter Jiang 0ba7c463c1 feat: add 7 months ago
.github/workflows Fix CI & Update dependencies 7 months ago
assets Update dependencies and release 0.3.1 1 year ago
ci Update CI 1 year ago
src feat: add 7 months ago
.gitignore add .vscode to gitignore 9 months ago
.travis.yml Update CI 1 year ago
Cargo.lock feat: code style & add 7 months ago
Cargo.toml feat: code style & add 7 months ago
LICENSE Update the copyright year to 2020 1 year ago Add install using Homebrew to the readme 9 months ago feat: add 7 months ago
appveyor.yml Update CI 1 year ago

Silicon Documentation CI Linux Build Status Windows build status License

Silicon is an alternative to Carbon implemented in Rust.

It can render your source code into a beautiful image.

Why Silicon

Carbon is a wonderful tool to create a beautiful image of your source code.

But it is a web application, which brings the following disadvantages:

  • Cannot work without Internet & browser.
  • Doesn't work well with shell. (Although there is carbon-now-cli, its experience is not very good, especially when the network is not so good.)

However, Silicon doesn't have these problem. It's is implemented in Rust and can work without browser & Internet.

Silicon can render your source code on the fly while carbon-now-cli takes several seconds on it.


It's not as beautiful as Carbon...



cargo install silicon


Silicon is available on AUR (Thanks to @radmen).

You can install it with any AUR helpers you like.


pikaur -S silicon


You can install Silicon using Homebrew:

brew install silicon



 sudo apt install expat
 sudo apt install libxml2-dev
 sudo apt install pkg-config libasound2-dev libssl-dev cmake libfreetype6-dev libexpat1-dev libxcb-composite0-dev

Arch Linux

sudo pacman -S --needed pkgconf freetype2 fontconfig libxcb xclip


Read code from file

silicon -o main.png 

Read code from clipboard, and copy the result image to clipboard(--to-clipboard is only available on Linux)

silicon --from-clipboard -l rs --to-clipboard

Use multiple fonts

silicon -o main.png -f 'Hack; SimSun'

Highlight specified line

silicon -o main.png --highlight-lines '1; 3-4'

Custom the image

silicon ./target/ -o test.png \
    --shadow-color '#555' --background '#fff' \
    --shadow-blur-radius 30 --no-window-controls

Transparent background

The color can be #RGB[A] or #RRGGBB[AA]

silicon ./target/ -o test.png --background '#fff0'

see silicon --help for detail