\documentclass[varwidth]{standalone}
\usepackage{graphicx, import ,xcolor, tikz}
\begin{document}
\begin{tikzpicture}
\draw [step=0.5] (-1.4,-1.4) grid (1.4,1.4);
\end{tikzpicture}
\begin{figure}
\centering
\import{}{diagram.pdf_tex} % SVG exported from Inkscape
\end{figure}
\end{document}
Convert into PDF :
pdflatex -output-dir=out content.tex && mv out/content.pdf content.pdf
Convert into PNG (using ImageMagik) :
convert -density 300 convert.pdf -quality 90 file.png
Solution : changing the policy.xml
of ImageMagick (/etc/ImageMagick-6/policy.xml
).
You can find more information here