7

I am trying to use png images that are transparent. This is an example of my LaTeX file (I am intentionally putting the images on top of themselves):

\documentclass[10pt,letterpaper]{article}    
\usepackage{graphicx}

\begin{document}
\begin{picture}(0,0)

\put(0,-350){\fbox{\includegraphics[height=4in]{baseimage.png}}}        
\put(0,-350){\fbox{\includegraphics[height=4in]{overlay.png  }}}    

\end{picture}

\end{document}

However, the top image looks like this:

enter image description here

The actual image just has a colored line, and no background. I've searched thoroughly online to find whether this any reason for this, and cannot find one.

The top of my log file says that my LaTeX version is the following:

This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2012.8.30) 

and I cannot spot any errors in the log file.

I've put one of the png files that I am using here.

  • I don't have any problems with your graphic. I see no black background and can put e.g. text "behind" the graphic. But my pdftex is much newer than yours: ` Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)`. – Ulrike Fischer Oct 31 '12 at 21:05
  • Thank you for testing it out. It sounds like I should upgrade pdftex (I had hesitated as it is on a server but trying to do it now). – celenius Oct 31 '12 at 21:17
  • Yes, upgrading seemed to fix this problem. Not sure if I should delete my question or not. – celenius Oct 31 '12 at 21:56
  • @celenius: No point in deleting the question. It may help others that run into a similar issue in the future. – Peter Grill Oct 31 '12 at 22:00
  • Transparency support for PNGs was added in pdfTeX 1.30.0. – Heiko Oberdiek Nov 2 '12 at 5:00
5

You have to use a newer version of pdfTeX, e.g. by installing the latest TeXLive or MikTeX.

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.