0

I'm trying to depict a sphere with shading

\documentclass[tikz]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
    \begin{tikzpicture}[scale = 2.5]
        \def\spradius{1}
        % draws a shaded sphere
        \shade[ball color = lightgray, opacity = 0.5] (0,0,0) circle (\spradius cm);
    \end{tikzpicture}
\end{document}

After compiling I have a next pdf image How it looks in pdf

But then I run a convert to png

magick convert -density 600 -depth 24 -quality 100 .pdf .png

on this pdf and get png after conversion

So those black lines become apparent.

What am I doing wrong?

dEmigOd
  • 397

1 Answers1

1

The point is the installed version of Ghostscript: Magick uses Ghostscript to convert PDF files into raster images. In some versions, shaded balls have this issue.

A possible solution is installing a newer version of Ghostscript before converting the PDFs. I had the same issue with Ghostscript v9.26, but after installing v9.54 (the most recent stable release at the time of writing) the lines disappeared.

I've used the following string to convert both images:

convert -density 600 -depth 24 -quality 100 .pdf .png

My sphere with GhostScript v9.26 My sphere with GhostScript v9.54