0

I generated an image with tikz which consists in an external image and a series of labels. I tried to convert it in .eps format by following the procedure presented here Export eps figures from TikZ. As result the .pdf image is good while I have a huge quality degradation in the .eps file.

In the preamble I included the following lines

\usetikzlibrary{external}
\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error 
-interaction=batchmode -jobname "\image" "\texsource";
pdftops -eps "\image".pdf;
ps2eps "\image.ps"}}
\tikzexternalize

and then I run the command

latex --shell-escape

Here a complete example of the code

\documentclass[]{article}

\usepackage{amsmath,bm} \usepackage{amssymb} \usepackage{esint} \usepackage{tabularx} \usepackage{graphicx} \usepackage{tikz} \usepackage{color} \usepackage{tikzscale}

\usetikzlibrary{external} \tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"; pdftops -eps "\image".pdf; ps2eps "\image.ps"}} \tikzexternalize

\begin{document}

\begin{figure*}

\begin{tikzpicture}

\node {\includegraphics[scale=0.15]{circle}}; \node {$\mathcal{SSSSSSSS}_1$};

\end{tikzpicture}

\end{figure*}

\end{document}

Original:

enter image description here

And here the .pdf and .eps images

enter image description here

enter image description here

Fly
  • 315
  • It would be beneficial to know which latex installation you use. And we would like more details as to what huge quality degradation actually means. All in all, it wopuld be better if you provided a full example that others can copy and which gives the quality problem on your system, then others can try it on their own separate systems – daleif Aug 11 '21 at 10:01
  • You have not given many clues but I would assume that for some reason pdftops is rasterising the page so your eps is a fixed resolution bitmap. Try instead pdf2ps I don't think that ever rasterises the image (or pdftops has options to control rasterisation see pdftops --help) – David Carlisle Aug 11 '21 at 10:08
  • I edited the question providing a running example and the results. Thank you for your help. – Fly Aug 11 '21 at 10:25
  • And where is circle? I'd say the circle image is irrelevant, the image should just be the SSS part – daleif Aug 11 '21 at 10:29
  • You also haven't told us which latex installation you are using. – daleif Aug 11 '21 at 10:30
  • The eps I get out on my system using TeXLive 2021 and Ubuntu 18.04 is clearly vector graphics (I removed the image that I don't have) – daleif Aug 11 '21 at 10:33
  • I don't know, but to me it looks like the exact same result. The only difference is, that one of them has an aliasing filter. Are both images viewed in the same vector graphics viewer? It might be only caused by the viewer program. If I recall correctly, post script doesn't support transparencies and maybe also not aliasing. – MaestroGlanz Aug 11 '21 at 10:37
  • And what do you consider to be the better quality? I prefer the later as the aliasing should be done by the viewer program as the last step. Otherwise the result will be not pleasant. – MaestroGlanz Aug 11 '21 at 10:38
  • @daleif I have Tex Live 2019/Debina and I work on a Ubuntu 20 machine – Fly Aug 11 '21 at 10:48
  • @MaestroGlanz The views are the same. Moreover the font of the label is not the same between pdf and eps image. Thank you again. – Fly Aug 11 '21 at 10:50
  • @Fly It is the same font. Just one time with aliasing, the other time without it. – MaestroGlanz Aug 12 '21 at 14:05
  • Is there a way to avoid the aliasing? – Fly Aug 13 '21 at 07:52
  • @Fly It depends, where the anti-aliasing comes from. The question is: Which software does the anti-aliasing. – MaestroGlanz Sep 25 '21 at 16:25

0 Answers0