I've got a problem converting a pdflatex-generated PDF image to a PNG image using the standalone package.
The pixelated rendering of the text in the converted image (PDF->PS->PNG via gs and ImageMagick?) is awfully blurry and inferior in quality (sharpness, crispness etc.) to the screen-dumped original PDF.
I have checked out these StackExchange posts:
and been guided in the setup of my workflow by the standalone package manual. But after considerable experimental adjustment of the various conversion settings in the code below, I have been unable to improve the quality of the outputted PNG image.
A sample of the settings I have played with:
- density (increase the dpi)
- size (increase/decrease the dimensions)
- the TikZ picture width/height dimensions (no optimum found, but if too small the PNG image width does not equal that specified among the documentclass parameters)
- using the
command={}
option, I have also played with options such as -quality and - set colorspace RGB (though I didn't really know what I was doing here)
Another approach I have taken is to try to set the TikZ picture width and height dimensions (in cm) in such a way that they agree with the conversion dimensions given among the documentclass parameters (using a dpi + pixels -> cm converter).
None of this worked! So any help in converting from PDF to PNG using the standalone package that preserves the sharpness and crispness of the rendered text in the image would be hugely appreciated.
For reference the versions of the various systems/applications I'm using are:
- Windows 7
- MiKTeX 2.9
- TeXnicCenter
- gs 9.09
- ImageMagick 6.8.6 Q16 (32-bit)
- standalone package installed using MiKTeX package manager late Aug 2013
\documentclass[preview,convert={density=300,size=900x300,outext=.png}]{standalone}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\begin{document}
\pgfplotsset{every x tick label/.style={at={(1,0)}, yshift=-0.15cm, xshift=-0.0cm, inner sep=0pt, font=\normalsize}}
\begin{tikzpicture}
\begin{axis}[
no markers, domain=-2.1*pi:2.1*pi, samples=1000,
width=30.0cm,
height=10.0cm,
axis x line*=middle,
x axis line style={densely dotted, opacity=0.75},
axis y line*=middle,
y axis line style={densely dotted, opacity=0.75},
ymin=-1.1,
ymax=1.1,
xtick={-6.28318530717959, -5.65486677646163, -5.02654824574367, -4.71238898038469, -4.39822971502571, -3.76991118430775, -3.14159265358979, -2.51327412287183, -1.88495559215388, -1.5707963267949, -1.25663706143592, -0.628318530717959, 0, 0.628318530717959, 1.25663706143592, 1.5707963267949, 1.88495559215388, 2.51327412287183, 3.14159265358979, 3.76991118430775, 4.39822971502571, 4.71238898038469, 5.02654824574367, 5.65486677646163, 6.28318530717959},
xticklabels={$-2\pi$, $-\frac{9\pi}{5}$, $-\frac{8\pi}{5}$, $-\frac{3\pi}{2}$, $-\frac{7\pi}{5}$, $-\frac{6\pi}{5}$, $-\pi$, $-\frac{4\pi}{5}$, $-\frac{3\pi}{5}$, $-\frac{\pi}{2}$, $-\frac{2\pi}{5}$, $-\frac{\pi}{5}$, $0$, $\frac{\pi}{5}$, $\frac{2\pi}{5}$, $\frac{\pi}{2}$, $\frac{3\pi}{5}$, $\frac{4\pi}{5}$, $\pi$, $\frac{6\pi}{5}$, $\frac{7\pi}{5}$, $\frac{\pi}{2}$, $\frac{8\pi}{5}$, $\frac{9\pi}{5}$, $2\pi$},
ytick=\empty,
enlargelimits=false, clip=true, axis on top]
\addplot [line width=0.5,cyan!50!black] {sin(deg(5*x))*cos(deg(x)};
\end{axis}
\end{tikzpicture}
\end{document}