1

I have exported the flowchart either in JPEG, and PNG format, and tried to insert this images to my latex project. Unfortunately, the image was blurred, text in the image can be shown normal if I open it on image viewer, but in latex, text hard to read it. My image resolution is 1002 x 1132. Why image resolution can't be preserved? How can I avoid blurred image in latex? Can anyone help me out how to resolve this issue? Any idea please?

Here is my latex code:

\begin{figure}[H]
    \includegraphics[width=\textwidth,height=0.685\textheight, scale=0.9]{workflow}
    \centering
    \caption{workflow}
    \label{fig: workflow}
\end{figure}

This is the original image I want to insert on my latex project original imaged. (Note that this image is generated by draw.io online tool)

This is the screenshot of the blurred image in latex:

inserted image in sharelatex

  • 2
    Latex does not change the resolution, it just embeds the image. Try with \includegraphics{workflow} , this won't fit on your page, but you will see that the original quality of the image is preserved. To avoid this problem, its better to include such an image in vector format, for example as .pdf – samcarter_is_at_topanswers.xyz Mar 21 '17 at 17:06
  • See my answer - in principle you could use the same code, but I'd advise for not using width, length and scale together. – samcarter_is_at_topanswers.xyz Mar 21 '17 at 17:15
  • @samcarter I did save the image in pdf format, but when I open it, above image divided to two pages. Why? How can I fix this? Thanks for your help :) – Jared Mar 21 '17 at 17:19
  • Can you share a link to your draw.io project? – samcarter_is_at_topanswers.xyz Mar 21 '17 at 17:22
  • 1
    OK, quick and dirty: use Din A3 paper as size - this will give you an ugly boarder. Long answer, select custom paper size and match it to the dimension of your image, which is 1000pt x 1130pt (you will have to move your image to the of the paper, which is marked by the dashed lines) and then export to pdf while selecting the "crop" option – samcarter_is_at_topanswers.xyz Mar 21 '17 at 17:52
3

For such graphics containing text and sharp lines it is better to use a vector format such as .pdf. From draw.io, you can export it to .pdf

enter image description here

This pdf can be included in the same way you currently include your image, but to avoid image distortion, only specify either width, length or scale.

\begin{figure}[htpb]
    \includegraphics[width=\textwidth]{workflow}
    %\centering
    \caption{workflow}
    \label{fig: workflow}
\end{figure}
| improve this answer | |
1

Your problem is that if you're using a4paper this has dimensions of 2480 px by 3508 px at 300 dpi. That's two times what your image has. But you force it to fit your page's width, what scales it. Since png and jpg are raster graphic formats you will see those blurs.

A possible solution would be to just use \includegraphics{workflow} (equals \includegraphics[scale=1]{workflow}) or to produce scalable graphics like svg or pdf.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.