CodeLumer CLI is a powerful wrapper around the silicon rendering engine, designed to automate the process of creating code-style screenshots.
While browser-based tools are great for one-offs, CodeLumer CLI is built for developers who need speed and automation. It can process entire directories of source code in seconds, applying consistent styling, fonts, and window controls to every image.
Made with β€οΈ and β by the Plantacerium
β Star us on GitHub if the script is useful to You! β
- π Batch Processing: Give it a folder, and it automatically finds
.py,.rs,.js,.go, and more, converting them all at once. - π¨ Beautiful Defaults: Comes pre-configured with the Dracula theme, drop shadows, and macOS-style window controls.
- π Font Control: Fully supports ligatures (Fira Code, Hack, JetBrains Mono) and custom sizes.
- π Highly Configurable: Toggle line numbers, adjust padding, change background colors, and swap themes on the fly.
- β‘ Blazing Fast: Powered by Rust (via
silicon), rendering images instantly without launching a browser.
This script relies on silicon for the rendering engine.
macOS (Homebrew):
brew install siliconLinux / Windows (via Cargo):
cargo install siliconClone this repo or download the script directly.
# Download the script
curl -o codelumer.sh [https://raw.githubusercontent.com/plantacerium/CodeLumer/main/codelumer.sh](https://raw.githubusercontent.com/plantacerium/CodeLumer/main/codelumer.sh)
# Make it executable
chmod +x codelumer.sh
# (Optional) Move to global path
sudo mv codelumer.sh /usr/local/bin/codesnapGenerate a snapshot of a single file using default settings (Dracula theme, 1920px width context).
sh codelumer.sh --font "Hack; Noto Color Emoji" --size 39 photo-test.shRecursively scan a directory and generate snapshots for all supported code files.
sh codelumer.sh --font "Hack; Noto Color Emoji" --size 39 ./phototestChange Theme and Font:
./codelumer.sh --theme Nord --font "JetBrains Mono" --size 28 app.rsMinimalist Style (No Window Controls or Line Numbers):
./codelumer.sh --no-window --no-line-numbers script.jsCustom Output Directory:
./codelumer.sh --output ./assets/blog-images ./srcCodeSnap CLI supports all standard .tmTheme syntax highlighting files.
To list all available themes on your machine:
./codelumer.sh --list-themesTip: You can install custom themes (like those from iTerm2-Color-Schemes) by placing
.tmThemefiles in~/.config/silicon/themes/.
This tool stands on the shoulders of giants. A huge thank you to:
- Aloxaf/silicon - The incredibly fast Rust-based image renderer that powers this script.
- Dracula Theme - The beautiful default color scheme used in our presets.
A robust Bash script using ImageMagick to automatically overlay a circular avatar onto a code snippet or screenshot, mimicking the modern "dual camera" or "picture-in-picture" recording style for professional content creation.
The script dynamically resizes the avatar relative to the background, applies a perfect circular mask, and adds a transparent shadow for a professional, floating effect.
- Dynamic Scaling: The avatar size is calculated as a percentage (default 20%) of the background image width, ensuring the avatar always fits regardless of the input resolution.
- Perfect Circle Masking: Uses ImageMagick's
DstIncomposite method for clean, artifact-free circular cropping. - Transparent Shadow: Applies a soft drop shadow to the avatar, ensuring it "floats" above the code without any white or black background boxes.
- Flexible Positioning: Supports placing the avatar in any of the four corners (Top-Left, Top-Right, Bottom-Left, Bottom-Right).
You must have ImageMagick installed on your system.
Installation Commands:
| OS | Command |
|---|---|
| macOS (Homebrew) | brew install imagemagick |
| Ubuntu/Debian | sudo apt-get install imagemagick |
| CentOS/RHEL | sudo yum install ImageMagick |
| Fedora | sudo dnf install ImageMagick |
- Save the Script: Save the provided Bash code as
lens_assembler.sh. - Make it Executable:
chmod +x lens_assembler.sh
The script requires a background image (-b) and an avatar image (-a).
./lens_assembler.sh -b code.png -a face.png -o reaction_shot.png| Flag | Description | Values | Default |
|---|---|---|---|
-b |
Required. Path to the background (code snippet) image. | [path/to/file] |
N/A |
-a |
Required. Path to the avatar (face) image. | [path/to/file] |
N/A |
-p |
Position of the avatar in the corner. | tl, tr, bl, br |
br (Bottom Right) |
-s |
Scale of the avatar as a percentage of the background width. | 1 to 100 |
20 |
-o |
Output filename. | [filename] |
output.png |
Example: Top Left, 15% Scale
./lens_assembler.sh -b code.png -a avatar.png -p tl -s 15 -o presentation_shot.pngThis project is licensed under the MIT License - see the [LICENSE]
Made with β€οΈ and β by the Plantacerium
β Star us on GitHub if the script is useful to You! β

