Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wojciechmula/tikz2png
Convert TikZ pictures into raster graphics
https://github.com/wojciechmula/tikz2png
converter graphics latex
Last synced: about 1 month ago
JSON representation
Convert TikZ pictures into raster graphics
- Host: GitHub
- URL: https://github.com/wojciechmula/tikz2png
- Owner: WojciechMula
- Created: 2019-12-01T08:47:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T20:11:52.000Z (10 months ago)
- Last Synced: 2024-10-26T22:04:56.262Z (3 months ago)
- Topics: converter, graphics, latex
- Language: Python
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
================================================================================
Convert TikZ pictures to PNG files (actually any raster format)
================================================================================``tikz2png`` script allows to easily convert `TikZ `_
pictures into any raster format.Requirements:
- Python 3;
- TeX installation provides ``pdflatex`` and ``tikz`` (in Debian packages
``texlive-latex-base`` and ``texlive-latex-extra`` installs these);
- ImageMagick.Example
--------------------------------------------------Content of ``example.tex``::
% taken from https://pgf-tikz.github.io/pgf/pgfmanual.pdf, page 43
\begin{tikzpicture}[even odd rule,rounded corners=2pt,x=10pt,y=10pt]
\filldraw[fill=yellow!80!black] (0,0) rectangle(1,1)
[xshift=5pt,yshift=5pt] (0,0) rectangle(1,1)
[rotate=30] (-1,-1) rectangle(2,2);
\end{tikzpicture}Default conversion::
$ tikz2png -i example.tex -o example1.png
.. image:: example1.png
Force white background::
$ tikz2png -i example.tex --background=white -o example2.png
.. image:: example2.png
No border::
$ tikz2png -i example.tex --border=0 -o example3.png
.. image:: example3.png
No border and background color::
$ tikz2png -i example.tex --border=0 --background=blue -o example4.png
.. image:: example4.png
./tikz2png --quality 100 -i example.tex -o example5.png
.. image:: example5.png
Installation
--------------------------------------------------Simply copy/symlink ``tikz2png`` to any directory in your ``$PATH``.