/image2tikz

Turn your image files into tikz source code.

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

GitHub Stars   GitHub Downloads

Follow us on Twitter  

Contributors   License   Size   Issues   Pull Requests   Commits   Latest Release   Release Date


image2tikz

Turns your raster images into tikz code. Use to recreate your images as PDFs. Output keeps bitmap properties.

Runs with questionable performance.

Why do this?

“Your scientists were so preoccupied with whether they could, they didn’t stop to think if they should.”

Usage

Intended as a CLI application. Use with 8-bit bitmap images without alpha channel. Use command line arguments to customize execution.

In a nutshell, run this tool like this:

python image2tikz.py -i <path/to/your/image>

Help

For help, use the -h argument:

python image2tikz.py -h

You can also create a Issue or Pull Request to help. Feedback is welcome.

Example Data

See the example directory of this repository for example input and output data. Located there is a mandrill.png. Converted pixel info (script output) is saved as a .pgf text file. It can be compiled to .pdf with LaTeX.

Note

High resolution images quickly exceed tikz' maximum memory limit. Recommended image size is 32x32 pixel. You also may include this library in your tex document:

\usepackage{morefloats}

Requirements

See requirements.txt in this repository.