freeze
Generate images of code and terminal output ๐ธ
Freeze is a command-line tool that turns code files and terminal output into images. You point it at a file, or pipe text into it, and it produces a clean PNG, SVG, or WebP image with syntax highlighting applied. The idea is to make code look presentable when sharing it in a blog post, tweet, or documentation, without taking a manual screenshot.
The tool tries to detect the programming language automatically from the file extension or file contents. If it guesses wrong, you can tell it the language explicitly. It supports a wide range of syntax color themes, so you can match the look to your preferences or your brand.
Beyond the basic conversion, Freeze offers a lot of visual controls. You can set the font family, font size, and line spacing. You can add rounded corners, a border, a drop shadow, window control decorations (the red, yellow, green dots familiar from macOS), background color, and padding or margin around the code block. If you only want to show a specific range of lines from a file, there is a flag for that too. Output files can be SVG, PNG, or WebP, and you can produce all three formats in one command.
For people who prefer a visual interface over typing flags, Freeze includes an interactive mode that lets you adjust settings in real time and see the result update as you go. Any settings you configure interactively are saved to a config file so they become your defaults for future runs.
Installation is available through Homebrew on macOS and Linux, through the Nix package manager, through the Arch Linux AUR, or by downloading pre-built binaries from the releases page. If you already have the Go toolchain installed, you can also install it with a single Go command.