I can successfully create PDF figures using TikZ and convert them with convert
(ImageMagick) to PNG such that retain a transparent background.
However, with the same procedure, for some of my figures, I instead get a white background. It seems that this happens whenever I have semi-transparent elements in the figure (see another SE-question, where this conclusion is implicit in the answer). This is on Mac OS X. If I use Inkscape, I can get a semi-transparent background, but it typically messes up the fonts (and I don't know how to do it via the CLI).
MWE:
\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[blue,fill=green,fill opacity=0.1] (0,0) circle (1);
\end{tikzpicture}
\end{document}
The \RequirePackage{luatex85}
is there because I use a very recent LuaTeX that causes problems with some packages.
Convert with convert -background transparent test.pdf test.png
.
The result is:
If fill opacity=0.1
is removed, the result looks as follows:
convert
version 6.8.9-9, I get the correct result.convert
is version 6.9.7-1. Is it a MacOSX specific thing? Or islualatex
the problem (mine is 0.95.0, TeX Live 2016) ?