[Tex/LaTex] png figures in latex

conversionmiktexpng

I have been struggling for a while trying to insert png figures. I want to use powerdot so I should go through latex->dvi->ps->pdf.

The following did work until my last update

\includegraphics[width=0.3\textwidth,bb=0 0 401 337]{DipoloSmoot.png}

No errors in LaTeX – dvips but in the ps2pdf step

I am using a MikTeX installation on Windows 10:

>>> pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
(preloaded format=latex 2016.8.6)
>>> dvips.exe -Ppdf "test_powerdot_png.dvi"
This is dvips(k) 5.996 Copyright 2016 Radical Eye Software
(www.radicaleye.com) *' TeX output 2016.08.06:1831' -> test_powerdot_png.ps

>>> "C:\Program Files\gs\gs9.19\bin\gswin64c.exe" -q -dSAFER -dNOPAUSE
-dBATCH -sOutputFile="test_powerdot_png.pdf" -sDEVICE=pdfwrite -c
-setpdfwrite -f "test_powerdot_png.ps"
...
Last OS error: No such file or directory
GPL Ghostscript 9.19: Unrecoverable error, exit code 1

Please forgive my inexperience, I don't know how to upload log and relevant files.
Any hint? Thank you in advance

Surfing around I see things similar to mine:

How to configure WinEdt/MikTeX/ps2pdf to use a new version of Ghostscript when converting ps->pdf?
which seems to be solved in the current MikTeX distribution.

However none of the solutions solves the problem.

Best Answer

After having installed ImageMagick®:

  • either convert images beforehand, as indicated by Akira KaKuto:

    > convert DipoloSmoot.png DipoloSmoot.eps
    

before running latex.

  • or insert in your tex file:

    \DeclareGraphicsRule{.png}{eps}{.bb}
    {`convert #1 -density 72x72 -units PixelsPerInch eps:-}
    

Depending on which program created the .png file, you may need to use the convert option -density 72x72 -units PixelsPerInch, in both cases.