[Tex/LaTex] tex4ht: reuse png images instead of creating new ones

graphicstex4ht

I have a lot of PNG images in my document, which (the document) I'd like to convert to HTML using tex4ht (htlatex). Now the images need to be in EPS format, as htlatex uses DVI mode. So I run convert foo.png foo.eps before I run htlatex. When generating the HTML, tex4ht creates a new PNG out of these EPS images, although I have the original which could (should) be used instead. That would save me quite some time and space.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\begin{document}

\section{something}
\includegraphics[width=5cm]{mill}
\end{document}

(mill.png is from the ConTeXt distribution, but could be any PNG file.)

Best Answer

You must provide extension for your graphics file:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\begin{document}

\section{something}
\includegraphics[width=5cm]{mill.png}
\end{document}

This compiles fine without need for the eps step