Skip to content
install

tool · one of 51 Pro saves the PNG

Code image

How do I post a code snippet as a good-looking picture?

Code pasted into a post loses its indentation and its colour, which is why people post pictures of it instead - usually made on a website the snippet is sent to. This highlights the code in the panel, in one of four themes, sets it in a window with a title bar and line numbers, on one of eight grounds, and the preview you tune is the canvas that is saved, at a smaller scale.

Reach it Press ⌘ + K on any tab and type code image. Ctrl + K on Windows and Linux

A code snippet highlighted in a window on a ground, as a picture to post
reads the code you paste
writes nothing
sends nothing
themes Night, Dawn, Nord and Ember
window title bar, line numbers, drop shadow
PNG twice the preview size
plan free to make · Pro saves the PNG
section#about

What this actually is

A tweet about a new API, a slide in a talk, a changelog entry or a README header. The code never leaves the machine, which matters when the snippet is from a private repository.

section#asked

Asked about this tool

Is my code sent to a service to be rendered?

No. The highlighting and the drawing both happen in the panel, and nothing is requested. That is the difference from the websites that do this.

Which languages does it highlight?

It knows comments, strings, numbers, function calls and the keywords of the dozen languages people usually post - JavaScript, TypeScript, Python, Ruby, shell and the like. It is a highlighter for a picture, not a parser, and it never drops a character it does not recognise.

Why twice the size?

Because most people will see it on a high-density screen, where an image at its drawn size looks soft. Twice the size stays sharp and still weighs little.

how to use code image

  1. Open Code image and paste the snippet into the code field.
  2. Choose a theme and a ground, and set the window title.
  3. Tune the text size, the padding, the line numbers and the shadow.
  4. Save it as a PNG at twice the size, sharp on any screen.