I’m sharing a new Open Source extension for Visual Studio Code that allows us to generate attractive images of our code.
Nowadays, creating eye-catching images of our code is a common need. For example, it’s useful for sharing them on social media, or incorporating them into a project’s documentation.
Evidence of this is the increased popularity of online services like, for example, the well-known Carbon or Ray.so.
There are also extensions for Visual Studio Code that allow us to perform the same procedure. Being able to generate the images directly from VSCode is much more convenient and faster.
Among the available options, probably the best is the CodeSnap extension. This one, in turn, is based on another very popular extension called Polacode.
Unfortunately, the development of CodeSnap is not active. At the time of writing this post, the last update was 17 months ago, it has 9 pending PRs, and 58 open issues.

So I created VSCodeSnap, which adds various improvements, such as:
- Background gradient
- Predefined palettes
- Line highlighting with three modes (|, +, and -)
- More control types (None, Mac OS, Gray Dot, and Windows)
- Zoom
- Button bar with copy and save.
- Others…
You can find VSCodeSnap in the Visual Studio Code extensions palette, to install and update it conveniently.

Of course, VSCodeSnap is Open Source and all the code is available on Github, where you also have the extended instructions and more examples of VSCodeSnap.
Download the Code
All the code from this post is available for download on Github.

