# TikZ standalone picture with semi-transparency converted to png looses transparency

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:

• As usual, we can do nothing without a MWE to test things on. Feb 12, 2017 at 20:49
• You are right of course, here it is. Feb 12, 2017 at 21:40
• Here, with convert version 6.8.9-9, I get the correct result. Feb 12, 2017 at 21:59
• Interesting! My convert is version 6.9.7-1. Is it a MacOSX specific thing? Or is lualatexthe problem (mine is 0.95.0, TeX Live 2016) ? Feb 12, 2017 at 22:23
• I ran it with pdflatex and lualatex (minus the luatex85, which crashed) and converted with Adobe Acrobat and GIMP with no problems. Gimp offered removing hidden or transparent layers as an option. Feb 13, 2017 at 2:56

convert calls gs (ghostscript) to convert a PDF file to PNG. gs version 9.10 seems produce a white background if the PDF file contains semi-transparent objects. A recent version of gs (as 9.19 or 9.20) produces the correct result.